Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1516 Refactor iceoryx_posh testing lib into own C…
Browse files Browse the repository at this point in the history
…Make file

Signed-off-by: Dietrich Kroenke <[email protected]>
  • Loading branch information
dkroenke committed Sep 28, 2022
1 parent 8679587 commit 969ec84
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
- `ReleativePointer::registerPtr` returns `cxx::optional` [\#605](https://github.com/eclipse-iceoryx/iceoryx/issues/605)
- `cxx::function` is no longer nullable [\#1104](https://github.com/eclipse-iceoryx/iceoryx/issues/1104)
- Renamed `BaseRelativePointer` to `UntypedRelativePointer` [\#605](https://github.com/eclipse-iceoryx/iceoryx/issues/605)
- Refactored `iceoryx_posh_testing` library into own CMakeLists.txt [\#1516](https://github.com/eclipse-iceoryx/iceoryx/issues/1516)

**Workflow:**

Expand Down
25 changes: 5 additions & 20 deletions iceoryx_posh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,28 +299,13 @@ setup_install_directories_and_export_package(
INCLUDE_DIRECTORY include/
)

if(ROUDI_ENVIRONMENT OR BUILD_TEST)
#
######### posh roudi environment ##########
#
find_package(iceoryx_hoofs_testing REQUIRED)
iox_add_library(
STATIC
TARGET iceoryx_posh_testing
NAMESPACE iceoryx_posh_testing
PROJECT_PREFIX ${PREFIX}
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/testing/include
INSTALL_INTERFACE include/${PREFIX}
PRIVATE_LIBS iceoryx_posh::iceoryx_posh
iceoryx_hoofs::iceoryx_hoofs
iceoryx_posh::iceoryx_posh_roudi
iceoryx_hoofs_testing::iceoryx_hoofs_testing
FILES
testing/roudi_environment/runtime_test_interface.cpp
testing/roudi_environment/roudi_environment.cpp
)
# Finding gtest and adding the subdirectories is split to support the use case of
# building the testing lib without the tests by providing gtest externally
if(NOT GTest_FOUND AND BUILD_TEST)
find_package(GTest CONFIG REQUIRED)
endif()

if(BUILD_TEST)
add_subdirectory(testing)
add_subdirectory(test)
endif()
41 changes: 41 additions & 0 deletions iceoryx_posh/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

# Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
# Copyright (c) 2020 - 2022 by Apex.AI Inc. All rights reserved.
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0

if(ROUDI_ENVIRONMENT OR BUILD_TEST)
#
######### posh roudi environment ##########
#
find_package(iceoryx_hoofs_testing REQUIRED)
iox_add_library(
STATIC
TARGET iceoryx_posh_testing
NAMESPACE iceoryx_posh_testing
PROJECT_PREFIX ${PREFIX}
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
INSTALL_INTERFACE include/${PREFIX}
PUBLIC_LIBS GTest::gtest
GTest::gmock
PRIVATE_LIBS iceoryx_posh::iceoryx_posh
iceoryx_hoofs::iceoryx_hoofs
iceoryx_posh::iceoryx_posh_roudi
iceoryx_hoofs_testing::iceoryx_hoofs_testing
FILES
roudi_environment/runtime_test_interface.cpp
roudi_environment/roudi_environment.cpp
)
endif()

0 comments on commit 969ec84

Please sign in to comment.