aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/jsoncpp.cmake
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2018-05-17 20:42:22 +0800
committerPaweł Bylica <chfast@gmail.com>2018-05-17 20:44:09 +0800
commit7db058074b97bdc6a36e372f8708d3adee62991c (patch)
treef2f5262206ab113fca40dbc430517e24d2b01059 /cmake/jsoncpp.cmake
parent0fdb226fd8d352f6b2b84e3efc61cd674e93ab1b (diff)
downloaddexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.tar
dexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.tar.gz
dexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.tar.bz2
dexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.tar.lz
dexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.tar.xz
dexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.tar.zst
dexon-solidity-7db058074b97bdc6a36e372f8708d3adee62991c.zip
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.
Diffstat (limited to 'cmake/jsoncpp.cmake')
-rw-r--r--cmake/jsoncpp.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/jsoncpp.cmake b/cmake/jsoncpp.cmake
index 3d6b37ed..cc2da7e7 100644
--- a/cmake/jsoncpp.cmake
+++ b/cmake/jsoncpp.cmake
@@ -7,8 +7,14 @@ else()
endif()
include(GNUInstallDirs)
+set(libdir ${CMAKE_INSTALL_LIBDIR})
+if(CMAKE_LIBRARY_ARCHITECTURE)
+ # Do not use Debian multiarch library dir.
+ string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" libdir ${libdir})
+endif()
+
set(prefix "${CMAKE_BINARY_DIR}/deps")
-set(JSONCPP_LIBRARY "${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
+set(JSONCPP_LIBRARY "${prefix}/${libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(JSONCPP_INCLUDE_DIR "${prefix}/include")
if(NOT MSVC)