WohlSoft / Moondust-Project

Moondust Project by Wohlstand
https://wohlsoft.ru/projects/Moondust/
GNU General Public License v3.0
246 stars 39 forks source link

[Build] Port whole project to CMake build system #259

Closed Wohlstand closed 5 years ago

Wohlstand commented 6 years ago

Port everything to CMake and completely drop support for QMake build system

Why

To do

Wohlstand commented 6 years ago

One note to optimize the library linking:

Instaed of using things like this:

list(APPEND PGE_MUSPLAY_LINK_LIBS
    ${SDL_MIXER_X_LIB}
    FLAC$<$<CONFIG:Debug>:d>
    opusfile$<$<CONFIG:Debug>:d>
    opus$<$<CONFIG:Debug>:d>
    vorbisfile$<$<CONFIG:Debug>:d>
    vorbis$<$<CONFIG:Debug>:d>
    ogg$<$<CONFIG:Debug>:d>
    mad$<$<CONFIG:Debug>:d>
    id3tag$<$<CONFIG:Debug>:d>
    modplug$<$<CONFIG:Debug>:d>
    ADLMIDI$<$<CONFIG:Debug>:d>
    OPNMIDI$<$<CONFIG:Debug>:d>
    timidity$<$<CONFIG:Debug>:d>
    gme$<$<CONFIG:Debug>:d>
    zlib$<$<CONFIG:Debug>:d>
)

Is a much better way to link dependencies (already used in libADLMIDI and libOPNMIDI projects, as example):

add_library(ADLMIDI_IF INTERFACE)
if(libADLMIDI_SHARED)
    target_link_libraries(ADLMIDI_IF INTERFACE ADLMIDI_shared)
else()
    target_link_libraries(ADLMIDI_IF INTERFACE ADLMIDI_static)
endif()

# ...

target_link_libraries(adlmidiplay ADLMIDI_IF ${SDL2_LIBRARY})
Wohlstand commented 6 years ago

Windows deployment note

As Windows builds are still rely on shared libraries, is need to use WinDeployQt tool to pull all dependent libraries. To easier make this, it's an example function made in another project:

https://github.com/equalsraf/neovim-qt/blob/master/cmake/WinDeployQt.cmake

Wohlstand commented 6 years ago

https://ci.appveyor.com/project/Wohlstand/pge-project/build/0.4.0.3.1303 First Windows build completely deployed through the CMake run.

The only left a macOS deployment to be ready to completely drop away the old building system.

Wohlstand commented 5 years ago

Since recent moment, QMake build support has been completely removed.

Wohlstand commented 5 years ago

Okay, looks like the whole CMake based system is works fine, so, I'll close this. Any future CMake build related works will be done in separated tasks.