Skip to content

Commit

Permalink
[eclipse-iceoryx#264] Make iceoryx2 version available for in-tree builds
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jul 5, 2024
1 parent 10f0ada commit 74833a5
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/c/discovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
cmake_minimum_required(VERSION 3.22)
project(example_c_discovery LANGUAGES C)

find_package(iceoryx2-c REQUIRED)
find_package(iceoryx2-c 0.3.0 REQUIRED)

add_executable(example_c_discovery src/main.c)

Expand Down
2 changes: 1 addition & 1 deletion examples/c/publish_subscribe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
cmake_minimum_required(VERSION 3.22)
project(example_c_publish_subscribe LANGUAGES C)

find_package(iceoryx2-c REQUIRED)
find_package(iceoryx2-c 0.3.0 REQUIRED)

add_executable(example_c_publisher src/publisher.c)
target_link_libraries(example_c_publisher iceoryx2-c::static-lib)
Expand Down
2 changes: 1 addition & 1 deletion examples/cxx/publish_subscribe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
cmake_minimum_required(VERSION 3.22)
project(example_cxx_publish_subscribe LANGUAGES CXX)

find_package(iceoryx2-cxx REQUIRED)
find_package(iceoryx2-cxx 0.3.0 REQUIRED)

add_executable(example_cxx_publisher src/publisher.cpp)
target_link_libraries(example_cxx_publisher iceoryx2-cxx::static-lib-cxx)
Expand Down
27 changes: 27 additions & 0 deletions iceoryx2-ffi/c/cmake/iceoryx2-cConfigVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

#
########## dummyConfig.cmake to be able to use find_package with a specific version with the source tree ##########
#

set(IOX2_VERSION_STRING "0.3.0")
set(PACKAGE_VERSION ${IOX2_VERSION_STRING})

if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
27 changes: 27 additions & 0 deletions iceoryx2-ffi/cxx/cmake/iceoryx2-cxxConfigVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

#
########## dummyConfig.cmake to be able to use find_package with a specific version with the source tree ##########
#

set(IOX2_VERSION_STRING "0.3.0")
set(PACKAGE_VERSION ${IOX2_VERSION_STRING})

if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

0 comments on commit 74833a5

Please sign in to comment.