diff options
author | Iru Cai <mytbk920423@gmail.com> | 2015-07-13 14:02:00 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2015-08-28 08:55:59 +0000 |
commit | c89a790d60eacce5a39ddbbe30161677f10b5bab (patch) | |
tree | 7bb47fc8534acf44ccc35784b5121d12b6d49a62 /src/common/CMakeLists.txt | |
parent | b806d39091b432389e906146b10f16aa707cae17 (diff) | |
download | fqterm-c89a790d60eacce5a39ddbbe30161677f10b5bab.tar.xz |
Qt 4 and 5 in one CMakeLists: subdirectories
Diffstat (limited to 'src/common/CMakeLists.txt')
-rw-r--r-- | src/common/CMakeLists.txt | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d3f0c09..30524fe 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -22,15 +22,27 @@ set(fqterm_common_SRCS fqterm_shortcuthelper.cpp ) -qt4_automoc(${fqterm_common_SRCS}) - -include_directories( - ${QT_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} -) +if(USE_QT5) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + find_package(Qt5Core REQUIRED) + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Multimedia REQUIRED) +else(USE_QT5) + qt4_automoc(${fqterm_common_SRCS}) + include_directories( + ${QT_INCLUDE_DIR} + ${QT_QTCORE_INCLUDE_DIR} + ${QT_QTGUI_INCLUDE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ) +endif(USE_QT5) add_library(fqterm_common ${fqterm_common_SRCS} ) + +if(USE_QT5) + target_link_libraries(fqterm_common Qt5::Core Qt5::Widgets Qt5::Multimedia) +endif(USE_QT5) +
\ No newline at end of file |