|
| 1 | +# Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +############################################################################### |
| 16 | +# CMake build rules for DDS Router Submodule |
| 17 | +############################################################################### |
| 18 | +cmake_minimum_required(VERSION 3.5) |
| 19 | + |
| 20 | +############################################################################### |
| 21 | +# Find package ddsrouter_cmake |
| 22 | +############################################################################### |
| 23 | +# Package ddsrouter_cmake is required to get every cmake macro needed |
| 24 | +find_package(ddsrouter_cmake REQUIRED) |
| 25 | + |
| 26 | +############################################################################### |
| 27 | +# Project |
| 28 | +############################################################################### |
| 29 | +# Configure project by info set in project_settings.cmake |
| 30 | +# - Load project_settings variables |
| 31 | +# - Read version |
| 32 | +# - Set installation paths |
| 33 | +configure_project() |
| 34 | + |
| 35 | +# Call explictly project |
| 36 | +project( |
| 37 | + ${MODULE_NAME} |
| 38 | + VERSION |
| 39 | + ${MODULE_VERSION} |
| 40 | + DESCRIPTION |
| 41 | + ${MODULE_DESCRIPTION} |
| 42 | +) |
| 43 | + |
| 44 | +############################################################################### |
| 45 | +# Test |
| 46 | +############################################################################### |
| 47 | +# Compile tests if CMake options requires it |
| 48 | +option(BUILD_COMPOSE_TESTS "Compile compose tests" OFF) |
| 49 | + |
| 50 | +if(BUILD_COMPOSE_TESTS) |
| 51 | + message(STATUS "Compiling Compose Tests of ${PROJECT_NAME}") |
| 52 | + configure_test_flags() |
| 53 | + test_requirements() |
| 54 | + add_subdirectory(compose) |
| 55 | +endif() |
| 56 | +# NOTE: this is done explicitly and not by a CMake macro (compile_test) as other packages |
| 57 | +# because it does not feel like reusable, so adding it to ddsrouter_cmake does not seems appropiate. |
| 58 | + |
| 59 | +############################################################################### |
| 60 | +# Packaging |
| 61 | +############################################################################### |
| 62 | +# NOTE: No packaging needed for this package as it is test only. However it removes the colcon warning. |
| 63 | +# Install package |
| 64 | +eprosima_packaging() |
0 commit comments