Skip to content

Commit d3b9ace

Browse files
authored
Explicitly set CMAKE_INSTALL_LIBDIR to lib (#81)
1 parent 77ca9ab commit d3b9ace

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
2727
# Set fPIC for all targets
2828
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2929

30+
# Set CMAKE_INSTALL_LIBDIR explicitly to lib (to avoid lib64 on CC7)
31+
set(CMAKE_INSTALL_LIBDIR lib)
32+
3033
# Set the default build type to "RelWithDebInfo"
3134
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
3235
set(CMAKE_BUILD_TYPE "RelWithDebInfo"
@@ -206,10 +209,10 @@ include(GNUInstallDirs)
206209
# Build targets with install rpath on Mac to dramatically speed up installation
207210
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
208211
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
209-
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
212+
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
210213
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
211214
if("${isSystemDir}" STREQUAL "-1")
212-
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
215+
set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}")
213216
endif()
214217
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
215218
endif()

0 commit comments

Comments
 (0)