I try to find a package (SDL2 and SDL2_image) I know exists and is installed in a custom directory. Since I am on Linux it should search all of these subdirectories, but it just does not and I see no reason why.
<prefix>/(lib/<arch>|lib*|share)/cmake/<name>*/ (U)
<prefix>/(lib/<arch>|lib*|share)/<name>*/ (U)
<prefix>/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/ (U)
<prefix>/<name>*/(lib/<arch>|lib*|share)/cmake/<name>*/ (W/U)
<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/ (W/U)
<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/ (W/U)
I tried CMAKE_PREFIX_PATH
, SDL2_ROOT
, HINTS
, PATHS
etc. and also checked the NO_*
variables, but even with set(CMAKE_FIND_DEBUG_MODE TRUE)
it just shows <prefix>/SDL2Config.cmake
and <prefix>/sdl2-config.cmake
as guesses for all of the prefixes it found.
I am at a loss, why it just refuses to search the documented subdirectories. I don't want to specify the full path, because that just hardcodes something that could change in the future and is different depending on the system.
I am using CMake 3.24.1. Any help is appreciated.
Code:
set(CMAKE_PREFIX_PATH ${SDL_INSTALL_DIR})
set(CMAKE_FIND_DEBUG_MODE TRUE)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
set(CMAKE_FIND_DEBUG_MODE FALSE)