CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake_modules/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:464 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found SDL2main: /usr/lib/x86_64-linux-gnu/libSDL2main.a (found version "2.0.20")
CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake_modules/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake_modules/FindSDL2_image.cmake:114 (find_package)
CMakeLists.txt:465 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so (found version "2.0.5")
CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake_modules/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake_modules/FindSDL2_mixer.cmake:112 (find_package)
CMakeLists.txt:469 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found SDL2_mixer: /usr/lib/x86_64-linux-gnu/libSDL2_mixer.so (found version "2.0.4")
CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake_modules/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake_modules/FindSDL2_ttf.cmake:114 (find_package)
CMakeLists.txt:473 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so (found version "2.0.18")
CI installs
libsdl2-image-2.0-0 libsdl2-mixer-2.0-0 libsdl2-ttf-2.0-0
on Linux
https://github.com/Alexander-Wilms/vcmi/blob/develop/CI/linux-qt6/before_install.sh
With all FindSDL2*.cmake files removed:
CMake Error at CMakeLists.txt:465 (find_package):
By not providing "FindSDL2_image.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
-- Configuring incomplete, errors occurred!
"SDL2_image", but CMake did not find one.
Could not find a package configuration file provided by "SDL2_image" with
any of the following names:
SDL2_imageConfig.cmake
sdl2_image-config.cmake
Add the installation prefix of "SDL2_image" to CMAKE_PREFIX_PATH or set
"SDL2_image_DIR" to a directory containing one of the above files. If
"SDL2_image" provides a separate development package or SDK, be sure it has
been installed.
Since 2.6 version, SDL2_image installation is shipped with CMake config script SDL2_imageConfig.cmake/SDL2_image-config.cmake.
So find_package(SDL2_image) works without any additional FindSDL2_image.cmake module, and creates IMPORTED target SDL2_image::SDL2_image:
find_package(SDL2_image REQUIRED)
target_link_libraries( SDL2_image::SDL2_image)
Note, that variables like SDL2_IMAGE_LIBRARIES or SDL2_IMAGE_INCLUDE_DIRS are NOT set in this case, so using them is meaningless.
https://stackoverflow.com/a/74147745/2278742
2.6.3 is available in 23.04:
https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=libsdl2-image&searchon=names
focal (20.04LTS) (libs): Image loading library for Simple DirectMedia Layer 2, libraries [universe]
2.0.5+dfsg1-2: amd64 arm64 armhf i386 ppc64el riscv64 s390x
jammy (22.04LTS) (libs): Image loading library for Simple DirectMedia Layer 2, libraries [universe]
2.0.5+dfsg1-3build1: amd64 arm64 armhf i386 ppc64el riscv64 s390x
lunar (23.04) (libs): Image loading library for Simple DirectMedia Layer 2, libraries [universe]
2.6.3+dfsg-1: amd64 arm64 armhf i386 ppc64el riscv64 s390x
mantic (23.10) (libs): Image loading library for Simple DirectMedia Layer 2, libraries [universe]
2.6.3+dfsg-2: amd64 arm64 armhf i386 ppc64el riscv64 s390x
noble (libs): Image loading library for Simple DirectMedia Layer 2, libraries [universe]
2.8.2+dfsg-1: amd64 arm64 armhf i386 ppc64el riscv64 s390x