Fixed bug 3078 - cmake: fix sdl2.m4 install location on cross hosts

Timo Gurr

On cross hosts running autotools for SDL2_gfx-1.0.1 fails to find sdl2.m4:

eautoreconf: running in /var/tmp/paludis/build/media-libs-SDL2_gfx-1.0.1/work/SDL2_gfx-1.0.1 ...
aclocal
aclocal-1.13: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:128: warning: macro 'AM_PATH_SDL2' not found in library
libtoolize --copy --force --automake
aclocal
aclocal-1.13: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:128: warning: macro 'AM_PATH_SDL2' not found in library
autoconf
configure.in:128: error: possibly undefined macro: AM_PATH_SDL2
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
 * Failed Running autoconf !

SDL2 installs it to /usr/x86_64-pc-linux-gnu/share/aclocal on cross hosts, attached patch makes use of CMAKE_INSTALL_FULL_DATAROOTDIR to support correctly installing to the arch independent location /usr/share/aclocal.
This commit is contained in:
Sam Lantinga 2016-10-01 15:11:18 -07:00
parent ac7d117475
commit c9be93c65b
1 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there") message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there")
endif() endif()
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8.5)
project(SDL2 C) project(SDL2 C)
# !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property # !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property
@ -26,6 +26,7 @@ include(CheckTypeSize)
include(CheckStructHasMember) include(CheckStructHasMember)
include(CMakeDependentOption) include(CMakeDependentOption)
include(FindPkgConfig) include(FindPkgConfig)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake")
include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) include(${SDL2_SOURCE_DIR}/cmake/macros.cmake)
include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
@ -1608,7 +1609,7 @@ if(NOT (WINDOWS OR CYGWIN))
endif() endif()
install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin) install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin)
# TODO: what about the .spec file? Is it only needed for RPM creation? # TODO: what about the .spec file? Is it only needed for RPM creation?
install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal")
endif() endif()
##### Uninstall target ##### ##### Uninstall target #####