Skip to content

Commit c4340a2

Browse files
authored
Fix CMAKE_INSTALL_LIBDIR definition (#471)
1 parent ea8b3c1 commit c4340a2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ set(SOAPY_SDR_ROOT_ENV "SOAPY_SDR_ROOT" CACHE STRING
6565
# select the release build type by default to get optimization flags
6666
########################################################################
6767
if(NOT CMAKE_BUILD_TYPE)
68-
set(CMAKE_BUILD_TYPE "Release")
69-
message(STATUS "Build type not specified: defaulting to release.")
68+
set(CMAKE_BUILD_TYPE "Release")
69+
message(STATUS "Build type not specified: defaulting to release.")
7070
endif(NOT CMAKE_BUILD_TYPE)
7171
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
7272

@@ -83,10 +83,11 @@ option(CMAKE_BUILD_WITH_INSTALL_RPATH "build with install rpath" FALSE)
8383
# the RPATH to be used when installing, but only if it's not a system directory
8484
option(CMAKE_AUTOSET_INSTALL_RPATH "install with automatic rpath" TRUE)
8585
if(CMAKE_AUTOSET_INSTALL_RPATH)
86-
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
87-
IF("${isSystemDir}" STREQUAL "-1")
88-
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
89-
ENDIF("${isSystemDir}" STREQUAL "-1")
86+
include(GNUInstallDirs)
87+
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
88+
if("${isSystemDir}" STREQUAL "-1")
89+
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
90+
endif("${isSystemDir}" STREQUAL "-1")
9091
endif(CMAKE_AUTOSET_INSTALL_RPATH)
9192

9293
# add the automatically determined parts of the RPATH

0 commit comments

Comments
 (0)