munt / munt

A multi-platform software synthesiser emulating pre-GM MIDI devices such as the Roland MT-32, CM-32L, CM-64 and LAPC-I. In no way endorsed by or affiliated with Roland Corp.

Home Page:http://munt.sourceforge.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static lib is not installed when LIB_INSTALL_DIR is specified

realnc opened this issue · comments

libmt32emu.a is not installed correctly when -DLIB_INSTALL_DIR= is used:

cd mt32emu
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="/tmp/mt32" -DLIB_INSTALL_DIR=lib -Dlibmt32emu_SHARED=OFF ../
make install

[snip build log]

Install the project...
-- Install configuration: ""
-- Installing: /tmp/munt/mt32emu/build/lib/libmt32emu.a
-- Installing: /tmp/mt32/include/mt32emu
-- Installing: /tmp/mt32/include/mt32emu/config.h
-- Installing: /tmp/mt32/include/mt32emu/c_interface
-- Installing: /tmp/mt32/include/mt32emu/c_interface/cpp_interface.h
-- Installing: /tmp/mt32/include/mt32emu/c_interface/c_types.h
-- Installing: /tmp/mt32/include/mt32emu/c_interface/c_interface.h
-- Installing: /tmp/mt32/include/mt32emu/Synth.h
-- Installing: /tmp/mt32/include/mt32emu/SampleRateConverter.h
-- Installing: /tmp/mt32/include/mt32emu/ROMInfo.h
-- Installing: /tmp/mt32/include/mt32emu/MidiStreamParser.h
-- Installing: /tmp/mt32/include/mt32emu/FileStream.h
-- Installing: /tmp/mt32/include/mt32emu/File.h
-- Installing: /tmp/mt32/include/mt32emu/Types.h
-- Installing: /tmp/mt32/include/mt32emu/Enumerations.h
-- Installing: /tmp/mt32/include/mt32emu/globals.h
-- Installing: /tmp/mt32/include/mt32emu/mt32emu.h
-- Installing: /tmp/mt32/include/mt32emu.h
-- Installing: /tmp/mt32/lib/pkgconfig/mt32emu.pc
-- Installing: /tmp/mt32/share/doc/munt/libmt32emu/AUTHORS.txt
-- Installing: /tmp/mt32/share/doc/munt/libmt32emu/COPYING.txt
-- Installing: /tmp/mt32/share/doc/munt/libmt32emu/COPYING.LESSER.txt
-- Installing: /tmp/mt32/share/doc/munt/libmt32emu/NEWS.txt
-- Installing: /tmp/mt32/share/doc/munt/libmt32emu/README.md
-- Installing: /tmp/mt32/share/doc/munt/libmt32emu/TODO.txt

I'd suggest to double-check the actual value of variable LIB_INSTALL_DIR set by CMake in the cache. Using the spell you wrote, it seems to assign the absolute path, while the description says it should contain a relative path. With a minor modification, this works for me:
cmake -DCMAKE_INSTALL_PREFIX="/tmp/mt32" -DLIB_INSTALL_DIR:PATH=lib -Dlibmt32emu_SHARED=OFF ../

<skip...>

Install the project...
-- Install configuration: ""
-- Installing: /tmp/mt32/lib/libmt32emu.a

<skip...>

Indeed, it uses an absolute path. With -DLIB_INSTALL_DIR=lib, the build directory is getting prepended, so it ends up as <build_dir>/lib.

-DLIB_INSTALL_DIR:PATH=lib on the other hand does the right thing.

In any event, I'm not sure this should be called LIB_INSTALL_DIR? The standard name for this in most software that uses cmake is CMAKE_INSTALL_LIBDIR. See:

https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

See the code on master branch ;)

Ah, oops. Forgot to check current git master. I use munt as a git submodule and have it pointed to the latest libmt32emu tag.

This bug report is actually invalid then, because on current git master, -DLIB_INSTALL_DIR=lib works just fine anyway, as does -DCMAKE_INSTALL_LIBDIR=lib.

Sorry for the noise :-P

No problem