Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port to CMake See merge request mer-core/mkcal!57
- Loading branch information
Showing
19 changed files
with
206 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ doxygen.* | |
*~ | ||
*.so* | ||
plugins/defaultinvitationplugin/libdefaultinvitationplugin.so | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
cmake_minimum_required(VERSION 3.11.4) | ||
|
||
project(mkcal | ||
VERSION 0.5.35 | ||
DESCRIPTION "Mkcal calendar library") | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
find_package(ECM REQUIRED NO_MODULE) | ||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) | ||
|
||
include(FeatureSummary) | ||
include(GNUInstallDirs) | ||
include(ECMGeneratePkgConfigFile) | ||
|
||
option(BUILD_PLUGINS "Build plugin" ON) | ||
option(BUILD_TESTS "Build tests" ON) | ||
option(INSTALL_TESTS "Install the tests to the system" OFF) | ||
option(BUILD_DOCUMENTATION "Build documentation" OFF) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
|
||
set(QT_MIN_VERSION "5.6.0") | ||
find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS DBus Gui Test REQUIRED) | ||
find_package(KF5 COMPONENTS CalendarCore REQUIRED) | ||
|
||
pkg_check_modules(TIMED timed-qt5 IMPORTED_TARGET REQUIRED) | ||
set_property(GLOBAL APPEND PROPERTY _CMAKE_timed-qt5_TYPE REQUIRED) | ||
pkg_check_modules(SQLITE3 sqlite3 IMPORTED_TARGET REQUIRED) | ||
set_property(GLOBAL APPEND PROPERTY _CMAKE_sqlite3_TYPE REQUIRED) | ||
|
||
if(TIMED_FOUND) | ||
set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND timed-qt5) | ||
else() | ||
set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND timed-qt5) | ||
endif() | ||
if(SQLITE3_FOUND) | ||
set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND sqlite3) | ||
else() | ||
set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND sqlite3) | ||
endif() | ||
|
||
add_subdirectory(src) | ||
add_subdirectory(tools) | ||
|
||
if(BUILD_PLUGINS) | ||
pkg_check_modules(QMF QmfClient IMPORTED_TARGET REQUIRED) | ||
set_property(GLOBAL APPEND PROPERTY _CMAKE_QmfClient_TYPE REQUIRED) | ||
|
||
if(QMF_FOUND) | ||
set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND QmfClient) | ||
else() | ||
set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND QmfClient) | ||
endif() | ||
|
||
add_subdirectory(plugins) | ||
endif() | ||
|
||
if(BUILD_TESTS) | ||
include(CTest) | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
if(BUILD_DOCUMENTATION) | ||
find_package(Doxygen REQUIRED) | ||
if(DOXYGEN_FOUND) | ||
add_subdirectory(doc) | ||
endif() | ||
endif() | ||
|
||
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
find_program(DOXYGEN NAMES doxygen) | ||
execute_process( | ||
COMMAND ${DOXYGEN} ${CMAKE_CURRENT_SOURCE_DIR}/libmkcal.cfg; ${CMAKE_CURRENT_SOURCE_DIR}/doc/xmlize.pl; | ||
) | ||
|
||
install(DIRECTORY html | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libmkcal-doc) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(defaultinvitationplugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set(SRC | ||
defaultinvitationplugin.cpp) | ||
set(HEADERS | ||
defaultinvitationplugin.h) | ||
|
||
add_library(defaultinvitationplugin ${SRC} ${HEADERS}) | ||
|
||
target_include_directories(defaultinvitationplugin PRIVATE ${PROJECT_SOURCE_DIR}/src) | ||
|
||
target_link_libraries(defaultinvitationplugin | ||
KF5::CalendarCore | ||
mkcal-qt5 | ||
PkgConfig::QMF) | ||
|
||
install(TARGETS defaultinvitationplugin | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/mkcalplugins) |
26 changes: 0 additions & 26 deletions
26
plugins/defaultinvitationplugin/defaultinvitationplugin.pro
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
set(SRC | ||
extendedcalendar.cpp | ||
extendedstorage.cpp | ||
notebook.cpp | ||
sqliteformat.cpp | ||
sqlitestorage.cpp | ||
servicehandler.cpp | ||
logging.cpp | ||
semaphore_p.cpp) | ||
set(HEADERS | ||
extendedcalendar.h | ||
extendedstorage.h | ||
extendedstorageobserver.h | ||
notebook.h | ||
sqliteformat.h | ||
sqlitestorage.h | ||
servicehandlerif.h | ||
servicehandler.h | ||
dummystorage.h | ||
mkcal_export.h | ||
logging_p.h | ||
semaphore_p.h | ||
invitationhandlerif.h | ||
config-mkcal.h) | ||
|
||
add_library(mkcal-qt5 SHARED ${SRC} ${HEADERS}) | ||
|
||
target_link_libraries(mkcal-qt5 | ||
PRIVATE | ||
Qt5::DBus | ||
PkgConfig::SQLITE3 | ||
PkgConfig::TIMED | ||
PUBLIC | ||
Qt5::Gui | ||
KF5::CalendarCore) | ||
|
||
set_target_properties(mkcal-qt5 PROPERTIES | ||
SOVERSION ${PROJECT_VERSION_MAJOR} | ||
VERSION ${PROJECT_VERSION}) | ||
|
||
add_definitions(-fvisibility=hidden -fvisibility-inlines-hidden) | ||
add_definitions(-DMKCALPLUGINDIR="${CMAKE_INSTALL_LIBDIR}/mkcalplugins") | ||
|
||
# Install the library | ||
install(TARGETS mkcal-qt5 | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
|
||
# Install headers | ||
install(FILES ${HEADERS} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mkcal-qt5 | ||
COMPONENT Devel) | ||
|
||
ecm_generate_pkgconfig_file( | ||
BASE_NAME libmkcal-qt5 | ||
LIB_NAME mkcal-qt5 | ||
INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/mkcal-qt5 | ||
DESCRIPTION ${PROJECT_DESCRIPTION} | ||
INSTALL) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
set(SRC | ||
tst_storage.cpp) | ||
set(HEADERS | ||
tst_storage.h) | ||
|
||
add_executable(tst_storage ${SRC} ${HEADERS}) | ||
|
||
target_include_directories(tst_storage PRIVATE ${PROJECT_SOURCE_DIR}/src) | ||
|
||
target_link_libraries(tst_storage | ||
Qt5::DBus | ||
Qt5::Test | ||
KF5::CalendarCore | ||
PkgConfig::SQLITE3 | ||
PkgConfig::TIMED | ||
mkcal-qt5) | ||
|
||
add_test(tst_storage tst_storage) | ||
|
||
if(INSTALL_TESTS) | ||
install(TARGETS tst_storage | ||
DESTINATION /opt/tests/mkcal) | ||
install(FILES tests.xml | ||
DESTINATION /opt/tests/mkcal) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(mkcaltool) |
Oops, something went wrong.