summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-02-23 11:40:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2012-08-22 10:58:43 (GMT)
commit25a4f5675490d9311db271942ecd1781de5f3558 (patch)
treec607ec56a6d9de42daefe1efffdb7f7933acfc12 /Source/QtDialog/CMakeLists.txt
parent717f31a877e701b801043b893c97f4a186f93739 (diff)
downloadCMake-25a4f5675490d9311db271942ecd1781de5f3558.zip
CMake-25a4f5675490d9311db271942ecd1781de5f3558.tar.gz
CMake-25a4f5675490d9311db271942ecd1781de5f3558.tar.bz2
Build with Qt5 if it is found.
Diffstat (limited to 'Source/QtDialog/CMakeLists.txt')
-rw-r--r--Source/QtDialog/CMakeLists.txt29
1 files changed, 23 insertions, 6 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 51e61d0..a1ffa20 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -9,16 +9,33 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
+
project(QtDialog)
-set(QT_MIN_VERSION "4.4.0")
-find_package(Qt4 REQUIRED)
+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()
-if(NOT QT4_FOUND)
- message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
- return()
+ include(${QT_USE_FILE})
endif()
-include(${QT_USE_FILE})
set(SRCS
AddCacheEntry.cxx
AddCacheEntry.h