Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to cmake #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.6.0)

project(voicecall
VERSION 0.7.11
DESCRIPTION "voicecall"
LANGUAGES CXX)


set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

include(FeatureSummary)
include(GNUInstallDirs)

set(QT_MIN_VERSION "5.6.0")
find_package(Qt5 COMPONENTS Core Quick DBus REQUIRED)
find_package(Qt5Multimedia REQUIRED)
find_package(PkgConfig REQUIRED)


set(LIBVOICECALL_DIR "${PROJECT_SOURCE_DIR}/lib/src")

add_subdirectory(lib/src)
add_subdirectory(src)
add_subdirectory(plugins)

add_subdirectory(oneshot)
add_subdirectory(rpm)
4 changes: 0 additions & 4 deletions lib/lib.pro

This file was deleted.

36 changes: 36 additions & 0 deletions lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

set(QT_MIN_VERSION "5.6.0")
find_package(Qt5 COMPONENTS Core DBus REQUIRED)


set(VOICECALL_LIB_SOURCES
dbus/voicecallmanagerdbusadapter.cpp
dbus/voicecallhandlerdbusadapter.cpp
abstractvoicecallhandler.cpp
common.cpp
)

set(VOICECALL_LIB_HEADERS
common.h
voicecallmanagerinterface.h
abstractnotificationprovider.h
abstractvoicecallhandler.h
abstractvoicecallprovider.h
abstractvoicecallmanagerplugin.h
dbus/voicecallmanagerdbusadapter.h
dbus/voicecallhandlerdbusadapter.h
)


add_library(voicecall SHARED ${VOICECALL_LIB_SOURCES} ${VOICECALL_LIB_HEADERS})
target_link_libraries(voicecall
Qt5::Core
Qt5::DBus
)

set_target_properties(voicecall PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})

install(TARGETS voicecall
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
32 changes: 0 additions & 32 deletions lib/src/src.pro

This file was deleted.

2 changes: 2 additions & 0 deletions oneshot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install(FILES phone-move-recordings-dir
DESTINATION ${CMAKE_INSTALL_LIBDIR}/oneshot.d/)
5 changes: 5 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_subdirectory(declarative)
add_subdirectory(mce)
add_subdirectory(ngf)
add_subdirectory(playback-manager)
add_subdirectory(providers)
2 changes: 2 additions & 0 deletions plugins/declarative/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(src)
add_subdirectory(test)
4 changes: 0 additions & 4 deletions plugins/declarative/declarative.pro

This file was deleted.

68 changes: 68 additions & 0 deletions plugins/declarative/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
SET(SRC
voicecallaudiorecorder.cpp
voicecallhandler.cpp
voicecallmanager.cpp
voicecallmodel.cpp
voicecallprovidermodel.cpp
voicecallplugin.cpp
../../../lib/src/common.cpp
)

SET(HEADERS
voicecallaudiorecorder.h
voicecallhandler.h
voicecallmanager.h
voicecallmodel.h
voicecallprovidermodel.h
voicecallplugin.h
)


add_definitions(-DPLUGIN_NAME="voicecall-ofono-plugin")

# FIXME debug
#add_definitions(-DWANT_TRACE)

# if enable-ngf
pkg_check_modules(NGF "ngf-qt5" REQUIRED)
add_definitions(-DWITH_NGF)
# endif enable-ngf


include_directories(${NGF_INCLUDE_DIRS} ${LIBVOICECALL_DIR})

add_library(voicecalldeclarative SHARED ${SRC} ${HEADERS})
add_dependencies(voicecalldeclarative voicecall)

target_link_libraries(voicecalldeclarative PUBLIC
Qt5::Core
Qt5::DBus
Qt5::Multimedia
Qt5::Quick
${NGF_LIBRARIES}
voicecall
)


#CONFIG += no_libvoicecall no_plugininstall
#TARGET = voicecall
#uri = org.nemomobile.voicecall
#OTHER_FILES += qmldir

function(FindQtInstallQml)
find_program(QMAKE NAMES qmake-qt5 qmake)
if(NOT QMAKE)
message(FATAL_ERROR "qmake not found")
endif()
execute_process(
COMMAND ${QMAKE} -query QT_INSTALL_QML
OUTPUT_VARIABLE PROC_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(QT_INSTALL_QML ${PROC_RESULT} PARENT_SCOPE)
endfunction()

FindQtInstallQml()

install(FILES qmldir DESTINATION ${QT_INSTALL_QML}/org/nemomobile/voicecall/)
install(TARGETS voicecalldeclarative DESTINATION ${QT_INSTALL_QML}/org/nemomobile/voicecall/)
2 changes: 1 addition & 1 deletion plugins/declarative/src/qmldir
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
module org.nemomobile.voicecall
plugin voicecall
plugin voicecalldeclarative
48 changes: 0 additions & 48 deletions plugins/declarative/src/src.pro

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions plugins/declarative/test/test.pro

This file was deleted.

1 change: 1 addition & 0 deletions plugins/mce/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(src)
5 changes: 0 additions & 5 deletions plugins/mce/mce.pro

This file was deleted.

18 changes: 18 additions & 0 deletions plugins/mce/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SET(SRC mceplugin.cpp)
SET(HEADERS mceplugin.h)

add_definitions(-DPLUGIN_NAME="mce-plugin")

include_directories(${LIBVOICECALL_DIR})

add_library(voicecall-mce-plugin SHARED ${SRC} ${HEADERS})
add_dependencies(voicecall-mce-plugin voicecall)

target_link_libraries(voicecall-mce-plugin PUBLIC
Qt5::Core
Qt5::DBus
voicecall
)

install(TARGETS voicecall-mce-plugin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/voicecall/plugins)
14 changes: 0 additions & 14 deletions plugins/mce/src/src.pro

This file was deleted.

1 change: 1 addition & 0 deletions plugins/ngf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(src)
4 changes: 0 additions & 4 deletions plugins/ngf/ngf.pro

This file was deleted.

21 changes: 21 additions & 0 deletions plugins/ngf/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SET(SRC ngfringtoneplugin.cpp)
SET(HEADERS ngfringtoneplugin.h)

pkg_check_modules(NGF "ngf-qt5" REQUIRED)

add_definitions(-DPLUGIN_NAME="ngf-plugin")

include_directories(${NGF_INCLUDE_DIRS} ${LIBVOICECALL_DIR})

add_library(voicecall-ngf-plugin SHARED ${SRC} ${HEADERS})
add_dependencies(voicecall-ngf-plugin voicecall)

target_link_libraries(voicecall-ngf-plugin PUBLIC
Qt5::Core
Qt5::DBus
${NGF_LIBRARIES}
voicecall
)

install(TARGETS voicecall-ngf-plugin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/voicecall/plugins)
13 changes: 0 additions & 13 deletions plugins/ngf/src/src.pro

This file was deleted.

1 change: 1 addition & 0 deletions plugins/playback-manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(src)
4 changes: 0 additions & 4 deletions plugins/playback-manager/playback-manager.pro

This file was deleted.

21 changes: 21 additions & 0 deletions plugins/playback-manager/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SET(SRC playbackmanagerplugin.cpp)
SET(HEADERS playbackmanagerplugin.h)

add_definitions(-DPLUGIN_NAME="voicecall-playback-manager-plugin")

# FIXME if debug
# add_definitions(-DWANT_TRACE)

include_directories(${LIBVOICECALL_DIR})

add_library(voicecall-playback-manager-plugin SHARED ${SRC} ${HEADERS})
add_dependencies(voicecall-playback-manager-plugin voicecall)

target_link_libraries(voicecall-playback-manager-plugin PUBLIC
Qt5::Core
Qt5::DBus
voicecall
)

install(TARGETS voicecall-playback-manager-plugin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/voicecall/plugins)
15 changes: 0 additions & 15 deletions plugins/playback-manager/src/src.pro

This file was deleted.

Loading