Skip to content

Commit

Permalink
Set RUNPATH in installed targets and fix roundtrip example install
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Masselink <[email protected]>
  • Loading branch information
PatrickM-ZS authored and eboasson committed Jul 18, 2024
1 parent 15949d4 commit 5b583a4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
include(CTest)

if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}")
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()

set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")

# Generate <Package>Config.cmake
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ add_subdirectory(throughput)

install(
FILES roundtrip/ping.cpp
roundtrip/ping.cpp
roundtrip/pong.cpp
roundtrip/roundtrip_common.hpp
roundtrip/RoundTrip.idl
roundtrip/CMakeLists.txt
roundtrip/readme.rst
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/throughput"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/roundtrip"
COMPONENT dev)

add_subdirectory(roundtrip)
2 changes: 1 addition & 1 deletion examples/helloworld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
project(helloworld LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.16)
project(helloworld LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)

Expand Down
2 changes: 1 addition & 1 deletion examples/roundtrip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
project(throughput LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.16)
project(throughput LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)

Expand Down
2 changes: 1 addition & 1 deletion examples/throughput/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
project(throughput LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.16)
project(throughput LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)

Expand Down

0 comments on commit 5b583a4

Please sign in to comment.