summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <philippe colliot>2014-06-15 17:47:38 +0200
committer <philippe colliot>2014-06-15 17:47:38 +0200
commit40c43fd3ae2210a2cfc634cf6628e97fbcd41d93 (patch)
treea5827c1bd75756f91ff74871de11b114cda0c36d
parentbe6bb6d254d991c2dceb7c4627954ba0c3b8716d (diff)
downloadpositioning-40c43fd3ae2210a2cfc634cf6628e97fbcd41d93.tar.gz
Migration to Qt5.2
-rw-r--r--.gitignore3
-rw-r--r--enhanced-position-service/CMakeLists.txt11
-rw-r--r--enhanced-position-service/src/CMakeLists.txt76
-rw-r--r--enhanced-position-service/src/serverimpl.h5
-rw-r--r--enhanced-position-service/test/CMakeLists.txt54
5 files changed, 89 insertions, 60 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c05fab7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+build/
+*~
+*.user
diff --git a/enhanced-position-service/CMakeLists.txt b/enhanced-position-service/CMakeLists.txt
index 7052ad3..9cb036c 100644
--- a/enhanced-position-service/CMakeLists.txt
+++ b/enhanced-position-service/CMakeLists.txt
@@ -13,11 +13,15 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
+# List of changes:
+#
+# 15/6/2014, Philippe Colliot, migrate to Qt5
+#
# @licence end@
###########################################################################
+cmake_minimum_required(VERSION 2.8.11)
project(enhanced-position-service)
-cmake_minimum_required(VERSION 2.6.0)
message(STATUS)
message(STATUS "---------------------------------------------------------")
@@ -39,11 +43,8 @@ if(WITH_REPLAYER)
endif()
set(QT_USE_QTDBUS TRUE)
-find_package(Qt4 COMPONENTS QtDBus REQUIRED )
-
-include_directories(api src test ${QT_INCLUDE_DIR} ${gnss-service_INCLUDE_DIRS} ${sensors-service_INCLUDE_DIRS})
-add_definitions(${QT_DEFINITIONS})
+include_directories(api src test ${gnss-service_INCLUDE_DIRS} ${sensors-service_INCLUDE_DIRS})
add_subdirectory(src)
message(STATUS "---------------------------------------------------------")
diff --git a/enhanced-position-service/src/CMakeLists.txt b/enhanced-position-service/src/CMakeLists.txt
index 4ddf4d9..8e8359c 100644
--- a/enhanced-position-service/src/CMakeLists.txt
+++ b/enhanced-position-service/src/CMakeLists.txt
@@ -13,11 +13,34 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
+# List of changes:
+#
+# 15/6/2014, Philippe Colliot, migrate to Qt5
+#
# @licence end@
###########################################################################
+cmake_minimum_required(VERSION 2.8.11)
+
project(position-daemon)
-cmake_minimum_required(VERSION 2.6.0)
+
+# Find includes in corresponding build directories
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Instruct CMake to run moc automatically when needed.
+set(CMAKE_AUTOMOC ON)
+
+# Manage packages
+find_package(PkgConfig)
+
+# Set Qt stuff
+find_package(Qt5Core)
+find_package(Qt5DBus)
+get_target_property(QtCore_location Qt5::Core LOCATION)
+get_target_property(QtDBus_location Qt5::DBus LOCATION)
+include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}")
message(STATUS "ENHANCED-POSITION-SERVICE")
message(STATUS "WITH_DLT = ${WITH_DLT}")
@@ -27,21 +50,28 @@ message(STATUS "WITH_TESTS = ${WITH_TESTS}")
include_directories("${PROJECT_SOURCE_DIR}/../../common")
-find_package(PkgConfig)
+set(LIBRARIES
+ ${Qt5Core_LIBRARIES}
+ ${Qt5DBus_LIBRARIES}
+ ${gnss-service_LIBRARIES}
+ ${sensors-service_LIBRARIES}
+)
+if(WITH_DLT)
+ add_definitions("-DDLT_ENABLED=1")
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/..")
+ find_package(DLT REQUIRED)
+ include_directories( ${DLT_INCLUDE_DIRS} )
+ set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
+endif()
+
+# Specify the paths in which the linker should search for libraries.
+# The command will apply only to targets created after it is called.
link_directories(
- ${QT_LIBRARY_DIR}
${gnss-service_LIBRARY_DIRS}
${sensors-service_LIBRARY_DIRS})
-set(server_HEADERS
- demoifadaptor.h
- serverimpl.h
- confifadaptor.h
- ConfigurationImpl.h
-)
-qt4_wrap_cpp(server_HEADERS_MOC ${server_HEADERS})
-
+# Tell CMake to create the position-daemon executable
add_executable(position-daemon
main.cpp
demoifadaptor.cpp
@@ -50,31 +80,11 @@ add_executable(position-daemon
confifadaptor.cpp
ConfigurationImpl.cpp
genivi-version.cpp
- ${server_HEADERS_MOC}
)
-set(LIBRARIES
- ${QT_QTDBUS_LIBRARY}
- #${QT_LIBRARIES}
- QtCore QtDBus QtXml # should not be required, failed automatic library detaction
- ${gnss-service_LIBRARIES}
- ${sensors-service_LIBRARIES}
-)
-
-if(WITH_DLT)
- add_definitions("-DDLT_ENABLED=1")
- set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/..")
- find_package(DLT REQUIRED)
- include_directories( ${DLT_INCLUDE_DIRS} )
- set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
-endif()
+target_link_libraries(position-daemon
+ ${LIBRARIES})
-target_link_libraries(position-daemon ${LIBRARIES})
-message(STATUS "QT_LIBRARIES: " ${QT_LIBRARIES})
-message(STATUS "QT_LIBRARY_DIR: " ${QT_LIBRARY_DIR})
-message(STATUS "QT_DBUS_LIBRARY: " ${QT_QTDBUS_LIBRARY})
-message(STATUS "GNSS_SERVICE_LIBRARIES: " ${gnss-service_LIBRARIES})
-message(STATUS "SENSORS_SERVICE_LIBRARIES: " ${sensors-service_LIBRARIES})
diff --git a/enhanced-position-service/src/serverimpl.h b/enhanced-position-service/src/serverimpl.h
index e085806..5c446ef 100644
--- a/enhanced-position-service/src/serverimpl.h
+++ b/enhanced-position-service/src/serverimpl.h
@@ -18,9 +18,8 @@
#ifndef SERVERIMPL_H
#define SERVERIMPL_H
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include <QtDBus/QDBusContext>
+#include <QtCore>
+#include <QtDBus>
#include "genivi-dbus-types.h"
#include "ConfigurationImpl.h"
diff --git a/enhanced-position-service/test/CMakeLists.txt b/enhanced-position-service/test/CMakeLists.txt
index 8bfbf23..418bf9d 100644
--- a/enhanced-position-service/test/CMakeLists.txt
+++ b/enhanced-position-service/test/CMakeLists.txt
@@ -13,30 +13,45 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
+# List of changes:
+#
+# 15/6/2014, Philippe Colliot, migrate to Qt5
+#
# @licence end@
###########################################################################
-project(position-daemon)
-cmake_minimum_required(VERSION 2.6.0)
+cmake_minimum_required(VERSION 2.8.11)
-link_directories(${QT_LIBRARY_DIR})
+project(test-client)
+
+# Find includes in corresponding build directories
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Instruct CMake to run moc automatically when needed.
+set(CMAKE_AUTOMOC ON)
+
+# Tell CMake where are Qt packages
+set(CMAKE_PREFIX_PATH $ENV{QTDIR})
+
+# Tell CMake what Qt components are used
+find_package(Qt5Core)
+find_package(Qt5DBus)
+get_target_property(QtCore_location Qt5::Core LOCATION)
+get_target_property(QtDBus_location Qt5::DBus LOCATION)
+include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}")
message(STATUS "ENHANCED-POSITION-SERVICE TEST-APPLICATION")
message(STATUS "WITH_DLT = ${WITH_DLT}")
message(STATUS "WITH_GPSD = ${WITH_GPSD}")
message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}")
-set(client_HEADERS
- demoif.h
- testclient.h
- confif.h
- ConfigurationClient.h
- signalhelper.h
- ../src/genivi-version.h
+set(LIBRARIES
+ ${Qt5Core_LIBRARIES}
+ ${Qt5DBus_LIBRARIES}
)
-qt4_wrap_cpp(client_HEADERS_MOC ${client_HEADERS})
-
add_library(ClientEnhpos STATIC
demoif.cpp
testclient.cpp
@@ -44,16 +59,17 @@ add_library(ClientEnhpos STATIC
ConfigurationClient.cpp
../src/genivi-version.cpp
signalhelper.cpp
- ${client_HEADERS_MOC}
)
-add_executable(test-client
- main-client.cpp
-)
+# Specify the paths in which the linker should search for libraries.
+# The command will apply only to targets created after it is called.
+link_directories(${QT_LIBRARY_DIR})
+
+# Tell CMake to create the test-client executable
+add_executable(test-client main-client.cpp)
target_link_libraries(test-client
- ${QT_QTDBUS_LIBRARY} # TODO fix this
- #${QT_LIBRARIES}
- QtCore QtDBus QtXml # TODO remove this if fixed
ClientEnhpos
+ ${LIBRARIES}
)
+