-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
74 lines (64 loc) · 2.21 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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)
if(MINGW)
option(LINK_STATIC_LIBS "link with static runtime libraries (MinGW only)" ON)
if(LINK_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lwsock32 -lws2_32 ${CMAKE_CXX_STANDARD_LIBRARIES}")
#This gets already set by libvgm...
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
set(GLFW3_LIBRARIES -static ${GLFW3_STATIC_LIBRARIES} -dynamic)
endif()
else()
option(LINK_STATIC_LIBS "link with static runtime libraries (MinGW only)" OFF)
endif()
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)
target_compile_definitions(mmlgui PRIVATE -DLOCAL_LIBVGM)
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()