all repos — mgba @ f98d6486efee2ee4ad9d2d4b3786004cb3ee4b76

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