CMake error, SDL_mixer could not find libxmp

125 views Asked by At

CMake Error:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find libxmp (missing: libxmp_LIBRARY libxmp_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  vendor/SDL_mixer/cmake/Findlibxmp.cmake:17 (find_package_handle_standard_args)
  vendor/SDL_mixer/CMakeLists.txt:616 (find_package)

My CMakeLists.txt:

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

set(ProjectName SnakeGameSDL)

set(RootSources src/main.cpp src/Map.cpp src/Game.cpp)
set(RootHeaders src/Map.hpp src/Game.hpp)

add_executable(${ProjectName} ${RootSources} ${RootHeaders})

add_subdirectory(src/CSDLContext)
add_subdirectory(src/CAppSettings)
add_subdirectory(src/CollideSystem)
add_subdirectory(src/FontManager)
add_subdirectory(src/Food)
add_subdirectory(src/GameScenes)
add_subdirectory(src/GameScore)

add_subdirectory(src/Observer)
add_subdirectory(src/AchievementSystem)
add_subdirectory(src/Snake)

add_subdirectory(src/SoundManager)
add_subdirectory(src/SpriteAnimation)
add_subdirectory(src/TextureManager)
add_subdirectory(src/Timer)

#Vendor

add_subdirectory(vendor/SDL)
target_link_libraries(${ProjectName} SDL)

add_subdirectory(vendor/SDL_image)
target_link_libraries(${ProjectName} SDL_image)

add_subdirectory(vendor/SDL_ttf)
target_link_libraries(${ProjectName} SDL_ttf)

add_subdirectory(vendor/SDL_mixer)
target_link_libraries(${ProjectName} SDL_mixer)

I have to add in vendor libxmp library and specify path or something like this in SDL_mixer cmake file or its completly wrong?. My target is to build project or there some more easier ways to get what i want?

1

There are 1 answers

0
HUSTRIK On BEST ANSWER

Not really a fix but for now no error, i just added this line in my root CMakeLists.txt

 set(SDL2MIXER_VENDORED ON CACHE BOOL "" FORCE) <-- this one

 add_subdirectory(vendor/SDL_mixer)
 target_link_libraries(${ProjectName} SDL_mixer)