diff --git a/CMakeLists.txt b/CMakeLists.txt index 517cf62..25af123 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,8 @@ OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF) OPTION(BUILD_STATIC_LIBS "Build jsoncpp_lib static library." ON) +include(GNUInstallDirs) + # Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix IF(NOT WIN32) IF(NOT CMAKE_BUILD_TYPE) @@ -114,7 +116,7 @@ IF(JSONCPP_WITH_PKGCONFIG_SUPPORT) "pkg-config/jsoncpp.pc" @ONLY) INSTALL(FILES "${CMAKE_BINARY_DIR}/pkg-config/jsoncpp.pc" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ENDIF() IF(JSONCPP_WITH_CMAKE_PACKAGE) diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index 99ddc7f..5861f03 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -48,8 +48,8 @@ IF(BUILD_SHARED_LIBS) INSTALL( TARGETS jsoncpp_lib ${INSTALL_EXPORT} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} - LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR}) + LIBRARY DESTINATION "${LIBRARY_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}" + ARCHIVE DESTINATION "${ARCHIVE_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}") IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11) TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib PUBLIC @@ -67,8 +67,8 @@ IF(BUILD_STATIC_LIBS) INSTALL( TARGETS jsoncpp_lib_static ${INSTALL_EXPORT} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} - LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR}) + LIBRARY DESTINATION "${LIBRARY_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}" + ARCHIVE DESTINATION "${ARCHIVE_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}") IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11) TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib_static PUBLIC