Skip to content

Commit 2f18bac

Browse files
committed
CMake: Fix libdir for jsoncpp external project in special case
When building on Debian/Ubuntu with install prefix /usr (e.g. in PPA builds) the CMAKE_INSTALL_LIBDIR is resolved to lib/x86_64-linux-gnu. For jsoncpp external project this is never the case because the install prefix is not /usr. Remove multiarch part from libdir if there.
1 parent 0fdb226 commit 2f18bac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/jsoncpp.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ else()
77
endif()
88

99
include(GNUInstallDirs)
10+
set(libdir ${CMAKE_INSTALL_LIBDIR})
11+
if(CMAKE_LIBRARY_ARCHITECTURE)
12+
# Do not use Debian multiarch library dir.
13+
string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" libdir ${libdir})
14+
endif()
15+
1016
set(prefix "${CMAKE_BINARY_DIR}/deps")
1117
set(JSONCPP_LIBRARY "${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
1218
set(JSONCPP_INCLUDE_DIR "${prefix}/include")

0 commit comments

Comments
 (0)