Does this support CMake find_package?
Issue #23
new
I'm new to CMake, and am trying to setup CMake for towave
in order to link statically with this library (instead of Ubuntu's bundled gme with poor ym2612 emulation). Does this library support find_package?
Comments (3)
-
Account Deleted reporter -
repo owner I added the CMake support before I realized that there was a difference between CMake config mode and module mode for FindPackage.
Although I'm mainly a C++ dev myself, the pkg-config interface is currently the only supported export interface (and that's in the
gme/CMakeLists.txt
, not the toplevel). That's mostly just due to lack of time, I'd be happy to add the proper CMake bits. -
Account Deactivated Continue at new repo: https://github.com/libgme/game-music-emu/issues/25
- Log in to comment
OS: Ubuntu 18.04.
Ended up importing the library using
add_subdirectory(game-music-emu)
which worked.Configuring static linking was difficult for me to find how to work. After much suffering, I found that
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared GME library")
worked.However, static linking ended up triggering thousands of linker errors, since
-static-libubsan
wasn't passed to GCC. To fix this issue, I partially modernized CMakeLists:cxx_flags
insteadset_target_properties
withcxx_flags
on each project in the dir (uses BUILDSYSTEM_TARGETS which requires CMake 3.7)target_link_libraries(gme ${cxx_flags})
on GME only. See Github diff.target_link_libraries
, or only pass-static-libubsan
.Now,
target_link_libraries(towave PRIVATE gme)
automatically inherits-static-libubsan
.https://github.com/jimbo1qaz/towave-j/commits/master/game-music-emu I think I should squash the 2 commits before sending a PR here.