Skip to content

Commit

Permalink
cmake: cannot install SDL2_image when SDL2 is also built but not inst…
Browse files Browse the repository at this point in the history
…alled
  • Loading branch information
madebr committed Feb 9, 2023
1 parent 7180f55 commit 44354bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@ else()
set(vendored_default OFF)
endif()

set(sdl2image_install_enableable ON)
if ((TARGET SDL2 OR TARGET SDL2-static) AND SDL2_DISABLE_INSTALL)
# Cannot install SDL2_image when SDL2 is built in same built, and is not installed.
set(sdl2image_install_enableable OFF)
endif()

include(CMakeDependentOption)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

option(CMAKE_POSITION_INDEPENDENT_CODE "Build static libraries with -fPIC" ON)
option(BUILD_SHARED_LIBS "Build the library as a shared library" ON)

option(SDL2IMAGE_INSTALL "Enable SDL2_image install target" ${SDL2IMAGE_ROOTPROJECT})
cmake_dependent_option(SDL2IMAGE_INSTALL "Enable SDL2_image install target" ${SDL2IMAGE_ROOTPROJECT} "${sdl2image_install_enableable}" OFF)
option(SDL2IMAGE_DEPS_SHARED "Load dependencies dynamically" ON)
option(SDL2IMAGE_VENDORED "Use vendored third-party libraries" ${vendored_default})

Expand Down

0 comments on commit 44354bc

Please sign in to comment.