Closed sezero closed 1 year ago
P.S.: With the patch above, cmake itself finds the xmp.h header but the compiler obviously does not.
P.P.S: Changing the patch the following way works for me.
diff --git a/cmake/Findlibxmp-lite.cmake b/cmake/Findlibxmp-lite.cmake
index 573409f..caeda68 100644
--- a/cmake/Findlibxmp-lite.cmake
+++ b/cmake/Findlibxmp-lite.cmake
@@ -1,12 +1,20 @@
include(FindPackageHandleStandardArgs)
find_library(libxmp_lite_LIBRARY
- NAMES xmp
+ NAMES xmp-lite
)
find_path(libxmp_lite_INCLUDE_PATH
NAMES xmp.h
)
+if(NOT libxmp_lite_INCLUDE_PATH)
+ find_path(libxmp_lite_INCLUDE_PATH
+ NAMES libxmp-lite/xmp.h
+ )
+ if(libxmp_lite_INCLUDE_PATH)
+ set(libxmp_lite_INCLUDE_PATH ${libxmp_lite_INCLUDE_PATH}/libxmp-lite)
+ endif()
+endif()
set(libxmp_lite_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of libxmp_lite")
@@ -21,7 +29,7 @@ find_package_handle_standard_args(libxmp_lite
if(libxmp_lite_FOUND)
if(NOT TARGET libxmp-lite::libxmp-lite)
add_library(libxmp-lite::libxmp-lite UNKNOWN IMPORTED)
- set_target_properties(libxmp_lite::libxmp_lite-shared PROPERTIES
+ set_target_properties(libxmp-lite::libxmp-lite PROPERTIES
IMPORTED_LOCATION "${libxmp_lite_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_lite_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${libxmp_lite_COMPILE_OPTIONS}"
@madebr: Had any chance to look at this?
I overlooked this issue. Sorry about that.
How do you build libxmp-lite? Running lite/configure
fails with the message below. Running autoreconf
does not work too
../configure: line 3640: syntax error near unexpected token `lt_decl_varnames,'
../configure: line 3640: `lt_if_append_uniq(lt_decl_varnames, SED, , ,'
The lite/CMakeLists.txt
also fails to configure.
By applying the patch below, I can let libxmp-lite start to build. But it fails quickly.
(I'm working on top of libsdl-org's vendored libxmp)
Yes, building libxmp-lite from git is not intuitive. Two options: Either
build from a release tarball, e.g. from https://github.com/libxmp/libxmp/releases/download/libxmp-4.5.0/libxmp-lite-4.5.0.tar.gz
or generate a tarball from git like this and build from it: In topdir, do:
./autogen.sh && make -f Makefile.lite
, take libxmp-lite-4.5.1.tar.gz
which is newly generated, extract it somewhere and build from it.
Tested this with SDL2 branch, but they are the same in SDL3 too.
With current source tree, running cmake with
-DSDL2MIXER_MOD_XMP_LITE=ON
I get:If I apply the following change, it succeeds (note that
-shared
is NOT present in Findlibxmp.cmake, only in the lite version..)... BUT, still with a developer warning:
I did not apply my patch above: Leaving things to @madebr. P.S.: With the patch above, cmake itself finds the xmp.h header but the compiler obviously does not.