Skip to content

Commit

Permalink
fix install of binaries with a static only library
Browse files Browse the repository at this point in the history
Define CMAKE_INSTALL_RPATH only if ENABLE_SHARED is set otherwise the
following issue occured:

CMake Error at iiod/cmake_install.cmake:45 (file):
  file RPATH_CHANGE could not write new RPATH:

    /usr/lib

  to the file:

    /home/pjtexier/<path>/usr/sbin/iiod

  No valid ELF RPATH or RUNPATH entry exists in the file; File does not have
  a valid ELF identification.
Call Stack (most recent call first):
  cmake_install.cmake:50 (include)

Signed-off-by: Pierre-Jean Texier <[email protected]>
  • Loading branch information
texierp committed Jun 23, 2019
1 parent b8f3bf9 commit 5090603
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif()

set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/${PROJECT_NAME}${LIBIIO_VERSION_MAJOR}-doc)")
include(GNUInstallDirs)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(ENABLE_SHARED AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
Expand Down

0 comments on commit 5090603

Please sign in to comment.