Skip to content

Commit

Permalink
cmake: don't prepend absolute CMAKE_INSTALL_{INCLUDE,LIB}DIR with ${p…
Browse files Browse the repository at this point in the history
…refix}
  • Loading branch information
madebr committed Sep 14, 2024
1 parent 2786290 commit 3166a05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/sdl3.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prefix=@SDL_PKGCONFIG_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@LIBDIR_FOR_PKG_CONFIG@
includedir=@INCLUDEDIR_FOR_PKG_CONFIG@

Name: sdl3
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
Expand Down
11 changes: 11 additions & 0 deletions cmake/sdltargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,17 @@ function(configure_sdl3_pc)
string(REGEX REPLACE "[/]+$" "" SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
set(SDL_PKGCONFIG_PREFIX "\${pcfiledir}/${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")

if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(INCLUDEDIR_FOR_PKG_CONFIG "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(INCLUDEDIR_FOR_PKG_CONFIG "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(LIBDIR_FOR_PKG_CONFIG "${CMAKE_INSTALL_LIBDIR}")
else()
set(LIBDIR_FOR_PKG_CONFIG "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()

configure_file("${SDL3_SOURCE_DIR}/cmake/sdl3.pc.in" "${SDL3_BINARY_DIR}/sdl3.pc" @ONLY)
endfunction()

Expand Down

0 comments on commit 3166a05

Please sign in to comment.