src/platform/qt/CMakeLists.txt (view raw)
1cmake_minimum_required(VERSION 2.8.8)
2project(mGBA-Qt)
3
4set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall -Wextra --std=c++11")
5set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall -Wextra --std=c++11")
6
7if(BUILD_SDL)
8 find_package(SDL 1.2 REQUIRED)
9 set(PLATFORM_LIBRARY "${PLATFORM_LIBRARY};${SDL_LIBRARY};${SDLMAIN_LIBRARY}")
10 set(PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c)
11 include_directories(${SDL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/platform/sdl)
12endif()
13
14set(CMAKE_AUTOMOC ON)
15set(CMAKE_INCLUDE_CURRENT_DIR ON)
16
17find_package(Qt5Widgets)
18find_package(OpenGL)
19
20if(NOT Qt5Widgets_FOUND OR NOT OPENGL_FOUND)
21 set(BUILD_QT OFF PARENT_SCOPE)
22 return()
23endif()
24
25set(SOURCE_FILES AudioDevice.cpp AudioProcessor.cpp Display.cpp GameController.cpp Window.cpp)
26
27if(USE_GDB_STUB)
28 set(SOURCE_FILES ${PLATFORM_SRC} ${SOURCE_FILES} GDBController.cpp GDBWindow.cpp)
29endif()
30set(MACOSX_BUNDLE_ICON_FILE mgba.icns)
31set(MACOSX_BUNDLE_BUNDLE_VERSION ${LIB_VERSION_STRING})
32set_source_files_properties(${CMAKE_SOURCE_DIR}/res/mgba.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
33
34add_executable(mGBA WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES})
35
36qt5_use_modules(mGBA Widgets Multimedia OpenGL)
37target_link_libraries(mGBA ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME} Qt5::Widgets)