Build with Qt5 if it is found.

This commit is contained in:
Stephen Kelly 2012-02-23 12:40:38 +01:00
parent 717f31a877
commit 25a4f56754
1 changed files with 24 additions and 7 deletions

View File

@ -9,16 +9,33 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
project(QtDialog)
find_package(Qt5Widgets QUIET)
if (Qt5Widgets_FOUND)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITONS})
macro(qt4_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt4_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
macro(qt4_add_resources)
qt5_add_resources(${ARGN})
endmacro()
set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
else()
set(QT_MIN_VERSION "4.4.0")
find_package(Qt4 REQUIRED)
if(NOT QT4_FOUND)
message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
return()
endif()
include(${QT_USE_FILE})
endif()
set(SRCS
AddCacheEntry.cxx
AddCacheEntry.h