summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDāvis Mosāns <davispuh@gmail.com>2016-09-08 00:26:12 +0300
committerJoerg Bornemann <joerg.bornemann@qt.io>2016-11-11 07:36:07 +0000
commitbce9a31a62a9e0cf2e7e3b8f29dc17e4c4669c6b (patch)
tree9c6be0970c7a6a699071b2c0e2f3fc71328a856e
parente93bb481016d910201a215ba712278d9cd993565 (diff)
Update CMake to use Qt5
Change-Id: I123657499b097473eef84cd493d16b7e8814d16c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--CMakeLists.txt20
-rw-r--r--src/jomlib/targetexecutor.h1
2 files changed, 7 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c0dd02..6e2cb0b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
project(jom)
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.11)
+set(CMAKE_AUTOMOC ON)
option(JOM_ENABLE_TESTS "Enable unit-testing for jom" OFF)
@@ -12,13 +13,9 @@ endif(JOM_ENABLE_TESTS)
# where to look first for cmake modules
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules;${CMAKE_MODULE_PATH}")
-# search for Qt4 - it is required
-find_package(Qt4 REQUIRED)
+find_package(Qt5Core)
-# some general definitions & the directories that should be included
-add_definitions(${QT_DEFINITIONS})
include_directories(
- ${QT_INCLUDES}
${CMAKE_BINARY_DIR}
src/jomlib
)
@@ -86,7 +83,6 @@ set(JOM_SRCS
)
# run moc on all headers and add the moc files to the SRCS
- qt4_wrap_cpp(JOM_GENERATED_SRCS ${JOM_MOCS})
list(APPEND JOM_SRCS ${JOM_GENERATED_SRCS} ${JOM_MOCS})
@@ -97,15 +93,14 @@ set(JOM_SRCS
src/app/main.cpp
src/app/application.cpp
)
- qt4_wrap_cpp(JOM_APP_GENERATED_SRCS ${JOM_APP_MOCS})
list(APPEND JOM_APP_SRCS ${JOM_APP_GENERATED_SRCS} ${JOM_APP_MOCS})
source_group("Generated Sources" FILES ${JOM_GENERATED_SRCS} ${JOM_APP_GENERATED_SRCS})
add_executable(jom ${JOM_APP_SRCS} ${JOM_SRCS})
if(WIN32)
- target_link_libraries(jom ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ws2_32)
+ target_link_libraries(jom Qt5::Core ws2_32)
else(WIN32)
- target_link_libraries(jom ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY})
+ target_link_libraries(jom Qt5::Core)
endif(WIN32)
# install binaries to bin/, libraries to lib/ and import libraries to lib/ too
@@ -117,11 +112,8 @@ set(JOM_SRCS
if(JOM_ENABLE_TESTS)
# in subdirectory tests:
set(TESTS_SRCS tests/tests.cpp tests/tests.h)
- qt4_wrap_cpp(TESTS_SRCS tests/tests.h)
add_executable(jom-test ${TESTS_SRCS} ${JOM_SRCS})
- target_link_libraries(jom-test ${QT_QTMAIN_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTTEST_LIBRARY})
+ target_link_libraries(jom-test Qt5::Core Qt5::Test)
# copy the data directory 'makefiles' over into the build directory as the tests should be run from there
file(GLOB_RECURSE JOM_TEST_DATA RELATIVE ${CMAKE_SOURCE_DIR}/tests/makefiles/ "tests/makefiles/*")
diff --git a/src/jomlib/targetexecutor.h b/src/jomlib/targetexecutor.h
index 9f04325..f1a5d32 100644
--- a/src/jomlib/targetexecutor.h
+++ b/src/jomlib/targetexecutor.h
@@ -27,6 +27,7 @@
#define TARGETEXECUTOR_H
#include "makefile.h"
+#include <QObject>
#include <QEvent>
#include <QtCore/QMap>