Clean up Qt CMakeLists
Jeffrey Pfau jeffrey@endrift.com
Mon, 13 Oct 2014 01:25:39 -0700
1 files changed,
6 insertions(+),
13 deletions(-)
jump to
M
src/platform/qt/CMakeLists.txt
→
src/platform/qt/CMakeLists.txt
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 2.8.8) project(mGBA-Qt) -set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra --std=c++11") -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -Wextra --std=c++11") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall -Wextra --std=c++11") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall -Wextra --std=c++11") if(BUILD_SDL) find_package(SDL 1.2 REQUIRED)@@ -14,17 +14,10 @@
set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(REQUIRES "Qt5Widgets") +find_package(Qt5Widgets) +find_package(OpenGL) -if(APPLE) - find_package(OpenGL REQUIRED) -else() - list(APPEND REQUIRES "OpenGL") -endif() - -find_feature(BUILD_QT ${REQUIRES}) - -if(NOT BUILD_QT) +if(NOT Qt5Widgets_FOUND OR NOT OPENGL_FOUND) set(BUILD_QT OFF PARENT_SCOPE) return() endif()@@ -41,4 +34,4 @@
add_executable(mGBA WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES}) qt5_use_modules(mGBA Widgets Multimedia OpenGL) -target_link_libraries(mGBA ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME}) +target_link_libraries(mGBA ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME} Qt5::Widgets)