Skip to content

Commit

Permalink
cmake: don't create relocatable packages by default with non-MSVC too…
Browse files Browse the repository at this point in the history
…lchains
  • Loading branch information
madebr committed Dec 28, 2024
1 parent d2e1fd9 commit e657092
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ cmake_dependent_option(SDLIMAGE_INSTALL "Enable SDL3_image install target" ${SDL
cmake_dependent_option(SDLIMAGE_INSTALL_CPACK "Create binary SDL3_image archive using CPack" ${SDLIMAGE_ROOTPROJECT} "SDLIMAGE_INSTALL" OFF)
cmake_dependent_option(SDLIMAGE_INSTALL_MAN "Install man pages for SDL3_image" OFF "SDLIMAGE_INSTALL" OFF)
cmake_dependent_option(SDLIMAGE_DEPS_SHARED "Load dependencies dynamically" ON PLATFORM_SUPPORTS_SHARED OFF)
cmake_dependent_option(SDLIMAGE_RELOCATABLE "Create relocatable SDL_image package" "${MSVC}" SDLIMAGE_INSTALL OFF)
option(SDLIMAGE_VENDORED "Use vendored third-party libraries" ${vendored_default})
option(SDLIMAGE_WERROR "Treat warnings as errors" OFF)

Expand Down Expand Up @@ -1076,9 +1077,13 @@ if(SDLIMAGE_INSTALL)
COMPONENT devel
)

file(RELATIVE_PATH SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/${SDLIMAGE_PKGCONFIG_INSTALLDIR}" "${CMAKE_INSTALL_PREFIX}")
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(SDLIMAGE_RELOCATABLE)
file(RELATIVE_PATH SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/${SDLIMAGE_PKGCONFIG_INSTALLDIR}" "${CMAKE_INSTALL_PREFIX}")
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}")
else()
set(SDL_PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
endif()

string(JOIN " " PC_REQUIRES ${PC_REQUIRES})
string(JOIN " " PC_LIBS ${PC_LIBS})
Expand Down
2 changes: 2 additions & 0 deletions build-scripts/release-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"-DSDLIMAGE_XCF=ON",
"-DSDLIMAGE_XPM=ON",
"-DSDLIMAGE_XV=ON",
"-DSDLIMAGE_RELOCATABLE=ON",
"-DSDLIMAGE_SAMPLES=OFF",
"-DSDLIMAGE_TESTS=OFF",
"-DSDLIMAGE_VENDORED=OFF"
Expand Down Expand Up @@ -148,6 +149,7 @@
"-DSDLIMAGE_XCF=ON",
"-DSDLIMAGE_XPM=ON",
"-DSDLIMAGE_XV=ON",
"-DSDLIMAGE_RELOCATABLE=ON",
"-DSDLIMAGE_SAMPLES=OFF",
"-DSDLIMAGE_TESTS=OFF",
"-DSDLIMAGE_VENDORED=ON"
Expand Down

0 comments on commit e657092

Please sign in to comment.