Skip to content

Commit

Permalink
Add CMake build system. Add libvgm submodule required for cmake builds
Browse files Browse the repository at this point in the history
  • Loading branch information
superctr committed Sep 15, 2022
1 parent fe2b298 commit 3d2586b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "ctrmml"]
path = ctrmml
url = https://github.com/superctr/ctrmml
[submodule "libvgm"]
path = libvgm
url = https://github.com/ValleyBell/libvgm
60 changes: 60 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
cmake_minimum_required(VERSION 3.11)
project(mmlgui LANGUAGES C CXX)

find_package(PkgConfig REQUIRED)
find_package(OpenGL REQUIRED)

pkg_check_modules(GLFW3 REQUIRED glfw3)
pkg_check_modules(CPPUNIT cppunit)

add_subdirectory(ctrmml)
add_subdirectory(libvgm)

add_library(gui
imgui/imgui.cpp
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
imgui/imgui_widgets.cpp
imgui/examples/imgui_impl_glfw.cpp
imgui/examples/imgui_impl_opengl3.cpp
imgui/examples/libs/gl3w/GL/gl3w.c
imgui/addons/imguifilesystem/imguifilesystem.cpp
ImGuiColorTextEdit/TextEditor.cpp)

target_include_directories(gui PUBLIC
imgui
imgui/examples
imgui/examples/libs/gl3w
ImGuiColorTextEdit
${GLFW3_INCLUDE_DIRS})

target_link_libraries(gui PUBLIC OpenGL::GL ${GLFW3_LIBRARIES})
target_compile_definitions(gui PUBLIC -DIMGUI_IMPL_OPENGL_LOADER_GL3W)

add_executable(mmlgui
src/main.cpp
src/window.cpp
src/main_window.cpp
src/editor_window.cpp
src/song_manager.cpp
src/track_info.cpp
src/track_view_window.cpp
src/track_list_window.cpp
src/audio_manager.cpp
src/emu_player.cpp
src/config_window.cpp
src/dmf_importer.cpp
src/miniz.c)

target_link_libraries(mmlgui PRIVATE ctrmml gui vgm-utils vgm-audio vgm-emu)

if(CPPUNIT_FOUND)
add_executable(mmlgui_unittest
src/track_info.cpp
src/unittest/test_track_info.cpp
src/unittest/main.cpp)
target_link_libraries(mmlgui_unittest ctrmml)
target_link_libraries(mmlgui_unittest ${CPPUNIT_LIBRARIES})
enable_testing()
add_test(NAME run_mmlgui_unittest COMMAND mmlgui_unittest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
2 changes: 1 addition & 1 deletion ctrmml
1 change: 1 addition & 0 deletions libvgm
Submodule libvgm added at 0e3492

0 comments on commit 3d2586b

Please sign in to comment.