diff --git a/CMakeLists.txt b/CMakeLists.txt index d9b7ea1e0..634e5531f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()