Skip to content

Commit

Permalink
Merge pull request #9 from eProsima/release/1.7.0
Browse files Browse the repository at this point in the history
Release/1.7.0
  • Loading branch information
richiware committed Dec 7, 2018
2 parents f5e69aa + 53702e4 commit 790867d
Show file tree
Hide file tree
Showing 24 changed files with 4,893 additions and 711 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Session.vim
tags

# End of https://www.gitignore.io/api/vim

compile_commands.json
91 changes: 91 additions & 0 deletions code/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.0)

file(STRINGS
${CMAKE_SOURCE_DIR}/../docs/conf.py
LIB_VERSION_TMP
REGEX "^version = u'[0-9]+.[0-9]+.[0-9]+'"
)

string(REGEX REPLACE "^version = u'([0-9]+.[0-9]+.[0-9]+)'"
"\\1"
LIB_VERSION_STR
${LIB_VERSION_TMP}
)

project(fastrtps-doc-checker VERSION "${LIB_VERSION_STR}" LANGUAGES C CXX)

########################################################################################################################
# Get documentation git branch
########################################################################################################################
find_package(Git REQUIRED)

execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE REPO_TAG)

########################################################################################################################
# Download and compile product
########################################################################################################################
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/external)

set(PRODUCT_CMAKELIST_CONTENT "
cmake_minimum_required(VERSION 3.0)
include(ExternalProject)
ExternalProject_Add(fastrtps
PREFIX product
GIT_REPOSITORY https://github.com/eProsima/Fast-RTPS.git
GIT_TAG origin/${REPO_TAG}
GIT_SHALLOW TRUE
CMAKE_GENERATOR Ninja
CMAKE_ARGS -DEPROSIMA_BUILD=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \"-DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/install\"
UPDATE_COMMAND \"\"
)
")

file(WRITE ${PROJECT_BINARY_DIR}/external/CMakeLists.txt "${PRODUCT_CMAKELIST_CONTENT}")

execute_process(COMMAND ${CMAKE_COMMAND} .
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external
)

execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external
)

set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${PROJECT_BINARY_DIR}/install)

find_package(fastrtps REQUIRED)


########################################################################################################################
# Compile example
########################################################################################################################
add_executable(doctest CodeTester.cpp)
target_link_libraries(doctest fastrtps)

########################################################################################################################
# Execute example
########################################################################################################################
enable_testing()
include(CTest)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/XMLTester.xml
${CMAKE_CURRENT_BINARY_DIR}/XMLTester.xml COPYONLY)

add_test(NAME doctest COMMAND doctest XMLTester.xml)

0 comments on commit 790867d

Please sign in to comment.