update for qt5

This commit is contained in:
arcan1s 2014-07-27 23:40:59 +04:00
parent f99afa8365
commit 1c03ab271a

View File

@ -12,8 +12,10 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/../
if (USE_QT5) if (USE_QT5)
find_package (Qt5Core REQUIRED) find_package (Qt5Core REQUIRED)
find_package (Qt5Widgets REQUIRED) find_package (Qt5Widgets REQUIRED)
find_package (Qt5Network REQUIRED)
add_definitions (${Qt5Core_DEFINITIONS}) add_definitions (${Qt5Core_DEFINITIONS})
add_definitions (${Qt5Widgets_DEFINITIONS}) add_definitions (${Qt5Widgets_DEFINITIONS})
add_definitions (${Qt5Network_DEFINITIONS})
qt5_wrap_cpp (MOC_SOURCES ${HEADERS}) qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
qt5_wrap_ui (UI_HEADERS ${FORMS}) qt5_wrap_ui (UI_HEADERS ${FORMS})
@ -21,9 +23,9 @@ if (USE_QT5)
source_group ("Source Files" FILES ${SOURCES}) source_group ("Source Files" FILES ${SOURCES})
source_group ("Generated Files" FILES ${MOC_SOURCES}) source_group ("Generated Files" FILES ${MOC_SOURCES})
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES}) add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES})
target_link_libraries (${SUBPROJECT} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES}) target_link_libraries (${SUBPROJECT} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES})
else () else ()
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED) find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
include (${QT_USE_FILE}) include (${QT_USE_FILE})
@ -35,7 +37,7 @@ else ()
source_group ("Generated Files" FILES ${MOC_SOURCES}) source_group ("Generated Files" FILES ${MOC_SOURCES})
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES}) add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES})
target_link_libraries (${SUBPROJECT} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) target_link_libraries (${SUBPROJECT} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY})
endif() endif()
# install properties # install properties