all repos — mgba @ 37212c1f238d25448cfde5a3ec16ca23ab036658

mGBA Game Boy Advance Emulator

src/platform/qt/CMakeLists.txt (view raw)

 1cmake_minimum_required(VERSION 2.8.8)
 2enable_language(CXX)
 3
 4set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
 5
 6if(BUILD_SDL)
 7	if(NOT SDL_FOUND AND NOT SDL2_FOUND)
 8		find_package(SDL 1.2 REQUIRED)
 9	endif()
10	if(SDL2_FOUND)
11		link_directories(${SDL2_LIBDIR})
12	endif()
13	set(PLATFORM_LIBRARY "${PLATFORM_LIBRARY};${SDL_LIBRARY};${SDLMAIN_LIBRARY}")
14	set(PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c)
15	include_directories(${SDL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/platform/sdl)
16endif()
17
18set(CMAKE_AUTOMOC ON)
19set(CMAKE_INCLUDE_CURRENT_DIR ON)
20
21find_package(Qt5Multimedia)
22find_package(Qt5OpenGL)
23find_package(Qt5Widgets)
24find_package(OpenGL)
25
26if(NOT Qt5Multimedia_FOUND OR NOT Qt5OpenGL_FOUND OR NOT Qt5Widgets_FOUND OR NOT OPENGL_FOUND)
27	set(BUILD_QT OFF PARENT_SCOPE)
28	return()
29endif()
30
31set(SOURCE_FILES
32	AudioDevice.cpp
33	AudioProcessor.cpp
34	ConfigController.cpp
35	Display.cpp
36	GBAApp.cpp
37	GameController.cpp
38	LoadSaveState.cpp
39	LogView.cpp
40	SavestateButton.cpp
41	Window.cpp
42	VFileDevice.cpp
43	VideoView.cpp)
44
45qt5_wrap_ui(UI_FILES
46	LoadSaveState.ui
47	LogView.ui
48	VideoView.ui)
49
50if(USE_GDB_STUB)
51	set(SOURCE_FILES ${PLATFORM_SRC} ${SOURCE_FILES} GDBController.cpp GDBWindow.cpp)
52endif()
53set(MACOSX_BUNDLE_ICON_FILE mgba.icns)
54set(MACOSX_BUNDLE_BUNDLE_VERSION ${LIB_VERSION_STRING})
55set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME})
56set(MACOSX_BUNDLE_GUI_IDENTIFIER com.endrift.${BINARY_NAME}-qt)
57set_source_files_properties(${CMAKE_SOURCE_DIR}/res/mgba.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
58
59qt5_add_resources(RESOURCES resources.qrc)
60if(WIN32)
61	list(APPEND RESOURCES ${CMAKE_SOURCE_DIR}/res/mgba.rc)
62endif()
63add_executable(mGBA WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${UI_FILES} ${RESOURCES})
64set_target_properties(mGBA PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/info.plist.in)
65
66qt5_use_modules(mGBA Widgets Multimedia OpenGL)
67target_link_libraries(mGBA ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME} Qt5::Widgets)