From ea9bece5ed4e76b6636d941101923487a6378ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= Date: Tue, 10 Aug 2021 18:51:33 +0100 Subject: [PATCH] Fix breaking GNUInstallDirs cmake module $CMAKE_INSTALL_LIBDIR directory. Fix #4621 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html `${CMAKE_INSTALL_LIBDIR} ` is only variable which should be used as base directory. Without that patch on 64 bit archs libraries, cmake modules and pkgconfig file are installed for example in /usr/lib6464 base directory. This patch fixes #4621. Signed-off-by: Tomasz Kłoczko --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26fe83205..9b7ae7098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2662,15 +2662,15 @@ endif() ##### Installation targets ##### install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ##### Export files ##### if (WINDOWS) set(PKG_PREFIX "cmake") else () - set(PKG_PREFIX "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}/cmake/SDL2") + set(PKG_PREFIX "${CMAKE_INSTALL_LIBDIR}/cmake/SDL2") endif () include(CMakePackageConfigHelpers) @@ -2717,7 +2717,7 @@ if(NOT (WINDOWS OR CYGWIN OR MINGW)) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\" WORKING_DIRECTORY \"${SDL2_BINARY_DIR}\")") - install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}") + install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() endif() if(FREEBSD) @@ -2725,7 +2725,7 @@ if(NOT (WINDOWS OR CYGWIN OR MINGW)) install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig") else() install(FILES ${SDL2_BINARY_DIR}/sdl2.pc - DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}/pkgconfig") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION "${CMAKE_INSTALL_BINDIR}") # TODO: what about the .spec file? Is it only needed for RPM creation?