1
1
project (qt_sdl)
2
2
3
3
SET (SOURCES_QT_SDL
4
- main.cpp
5
- main_shaders.h
6
- EmuSettingsDialog.cpp
7
- InputConfigDialog.cpp
8
- VideoSettingsDialog.cpp
9
- AudioSettingsDialog.cpp
10
- WifiSettingsDialog.cpp
11
- Input .cpp
12
- LAN_PCap.cpp
13
- LAN_Socket.cpp
14
- OSD.cpp
15
- OSD_shaders.h
16
- font.h
17
- Platform.cpp
18
- PlatformConfig.cpp
19
-
20
- ../Util_ROM.cpp
21
- ../Util_Video.cpp
22
- ../Util_Audio.cpp
23
- ../FrontendUtil.h
24
- ../mic_blow.h
25
-
26
- ../../../melon.qrc
4
+ main.cpp
5
+ main_shaders.h
6
+ EmuSettingsDialog.cpp
7
+ InputConfigDialog.cpp
8
+ VideoSettingsDialog.cpp
9
+ AudioSettingsDialog.cpp
10
+ WifiSettingsDialog.cpp
11
+ Input .cpp
12
+ LAN_PCap.cpp
13
+ LAN_Socket.cpp
14
+ OSD.cpp
15
+ OSD_shaders.h
16
+ font.h
17
+ Platform.cpp
18
+ PlatformConfig.cpp
19
+
20
+ ../Util_ROM.cpp
21
+ ../Util_Video.cpp
22
+ ../Util_Audio.cpp
23
+ ../FrontendUtil.h
24
+ ../mic_blow.h
25
+
26
+ ../../../melon.qrc
27
27
)
28
28
29
29
if (WIN32 )
30
- set (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>" )
30
+ set (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>" )
31
31
endif ()
32
32
33
33
if (BUILD_STATIC AND QT5_STATIC_DIR)
34
- set (QT5_STATIC_BASE ${QT5_STATIC_DIR} /lib/cmake/Qt5)
35
- set (Qt5_DIR ${QT5_STATIC_BASE} )
36
- set (Qt5Core_DIR ${QT5_STATIC_BASE} Core)
37
- set (Qt5Gui_DIR ${QT5_STATIC_BASE} Gui)
38
- set (Qt5Widgets_DIR ${QT5_STATIC_BASE} Widgets)
34
+ set (QT5_STATIC_BASE ${QT5_STATIC_DIR} /lib/cmake/Qt5)
35
+ set (Qt5_DIR ${QT5_STATIC_BASE} )
36
+ set (Qt5Core_DIR ${QT5_STATIC_BASE} Core)
37
+ set (Qt5Gui_DIR ${QT5_STATIC_BASE} Gui)
38
+ set (Qt5Widgets_DIR ${QT5_STATIC_BASE} Widgets)
39
39
endif ()
40
40
41
41
find_package (Qt5 COMPONENTS Core Gui Widgets REQUIRED)
@@ -44,64 +44,50 @@ set(CMAKE_AUTOMOC ON)
44
44
set (CMAKE_AUTOUIC ON )
45
45
set (CMAKE_AUTORCC ON )
46
46
47
+ find_package (Threads REQUIRED)
48
+ find_package (Iconv REQUIRED)
47
49
find_package (PkgConfig REQUIRED)
48
50
pkg_check_modules(SDL2 REQUIRED sdl2)
51
+ pkg_check_modules(SLIRP REQUIRED slirp)
49
52
50
53
if (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Release))
51
- add_executable (melonDS WIN32 ${SOURCES_QT_SDL} )
54
+ add_executable (melonDS WIN32 ${SOURCES_QT_SDL} )
52
55
else ()
53
- add_executable (melonDS ${SOURCES_QT_SDL} )
56
+ add_executable (melonDS ${SOURCES_QT_SDL} )
54
57
endif ()
55
58
59
+ target_link_libraries (melonDS ${CMAKE_THREAD_LIBS_INIT} )
60
+
56
61
target_include_directories (melonDS PRIVATE ${SDL2_INCLUDE_DIRS} )
57
62
target_include_directories (melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR} " )
58
63
target_include_directories (melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR} /.." )
59
64
target_include_directories (melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR} /../.." )
60
65
target_link_libraries (melonDS core)
61
66
62
67
if (BUILD_STATIC)
63
- target_link_libraries (melonDS -static ${SDL2_LIBRARIES} )
68
+ target_link_libraries (melonDS -static ${SDL2_LIBRARIES} ${SLIRP_LIBRARIES } )
64
69
else ()
65
- target_link_libraries (melonDS ${SDL2_LIBRARIES} )
70
+ target_link_libraries (melonDS ${SDL2_LIBRARIES} ${SLIRP_LIBRARIES } )
66
71
endif ()
67
72
68
73
if (UNIX )
69
- option (UNIX_PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF )
70
- if (UNIX_PORTABLE)
71
- add_definitions (-DUNIX_PORTABLE)
72
- endif ()
73
-
74
- find_package (PkgConfig REQUIRED)
75
- pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
76
-
77
- target_include_directories (melonDS PRIVATE ${GTK3_INCLUDE_DIRS} )
78
- target_link_libraries (melonDS ${GTK3_LIBRARIES} )
79
-
80
- ADD_DEFINITIONS (${GTK3_CFLAGS_OTHER} )
81
-
82
- add_custom_command (OUTPUT melon_grc.c
83
- COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR}
84
- --target =${CMAKE_CURRENT_BINARY_DIR} /melon_grc.c
85
- --generate-source "${CMAKE_SOURCE_DIR} /melon_grc.xml"
86
- COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR}
87
- --target =${CMAKE_CURRENT_BINARY_DIR} /melon_grc.h
88
- --generate-header "${CMAKE_SOURCE_DIR} /melon_grc.xml" )
89
-
90
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
91
- target_link_libraries (melonDS dl slirp Qt5::Core Qt5::Gui Qt5::Widgets)
92
- endif ()
93
-
94
- target_sources (melonDS PUBLIC melon_grc.c)
74
+ option (PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF )
75
+ target_link_libraries (melonDS dl Qt5::Core Qt5::Gui Qt5::Widgets)
95
76
elseif (WIN32 )
96
- target_sources (melonDS PUBLIC "${CMAKE_SOURCE_DIR} /melon.rc" )
97
-
98
- target_link_libraries (melonDS slirp comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32)
99
- if (BUILD_STATIC)
100
- target_link_libraries (melonDS imm32 winmm version setupapi -static Qt5::Core Qt5::Gui Qt5::Widgets z zstd glib-2.0 intl iconv)
101
- else ()
102
- target_link_libraries (melonDS Qt5::Core Qt5::Gui Qt5::Widgets)
103
- endif ()
104
- endif ()
77
+ option (PORTABLE "Make a portable build that looks for its configuration in the current directory" ON )
78
+ target_sources (melonDS PUBLIC "${CMAKE_SOURCE_DIR} /melon.rc" )
79
+
80
+ target_link_libraries (melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32)
81
+ if (BUILD_STATIC)
82
+ target_link_libraries (melonDS imm32 winmm version setupapi -static Qt5::Core Qt5::Gui Qt5::Widgets z zstd glib-2.0 intl iconv)
83
+ else ()
84
+ target_link_libraries (melonDS Qt5::Core Qt5::Gui Qt5::Widgets)
85
+ endif ()
86
+ endif ()
87
+
88
+ if (PORTABLE)
89
+ add_definitions (-DPORTABLE)
90
+ endif ()
105
91
106
92
install (FILES ../../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX} /share/applications)
107
93
install (FILES ../../../icon/melon_16x16.png DESTINATION ${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/16x16/apps RENAME net.kuribo64.melonDS.png)
0 commit comments