diff --git a/CMakeLists.txt b/CMakeLists.txt index 64d3d239..3138a8c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,189 +1,191 @@ project(kplato) # set kplato debug area add_definitions( -DKDE_DEFAULT_DEBUG_AREA=42000 ) if(KF5Holidays_FOUND) add_definitions(-DHAVE_KHOLIDAYS) endif() if (KF5AkonadiContact_FOUND) # disable for now: there is a bug # it only works if you use kde contacts (of course) but many use other stuff, so gets dissapointed # add_definitions(-DPLAN_KDEPIMLIBS_FOUND) message(WARNING "AkonadiContacs available, but funtion is disabled due to Bug 311940") endif () #### Disable kreport, reconsidder when stable #### # if (KReport_FOUND AND KReport_VERSION_MAJOR EQUAL 3 AND KReport_VERSION_MINOR EQUAL 0 AND KReport_VERSION_PATCH LESS 80) # message(STATUS "Acceptable KReport version: ${KReport_VERSION}") # add_definitions(-DPLAN_USE_KREPORT) # set(PLAN_BUILD_REPORTS true) # else() # message(WARNING "Unacceptable KReport version: ${KReport_VERSION}") # endif() if (PLANCHARTDEBUG) add_definitions(-DPLAN_CHART_DEBUG) endif () set( KPLATO_INCLUDES ${CMAKE_SOURCE_DIR}/plan/libs/kernel ${CMAKE_BINARY_DIR}/plan/libs/kernel ${CMAKE_SOURCE_DIR}/plan/libs/models ${CMAKE_BINARY_DIR}/plan/libs/models ${CMAKE_SOURCE_DIR}/plan/libs/ui ${CMAKE_BINARY_DIR}/plan/libs/ui ${CMAKE_BINARY_DIR}/plan ${KOMAIN_INCLUDES} ) add_subdirectory( libs ) add_subdirectory( templates ) add_subdirectory( pics ) add_subdirectory( toolbar ) add_subdirectory( plugins ) -add_subdirectory( tests ) +if(BUILD_TESTING) + add_subdirectory( tests ) +endif() add_subdirectory( workpackage ) include_directories(${KPLATO_INCLUDES}) add_definitions(-DTRANSLATION_DOMAIN=\"calligraplan\") ########### KPlato private library ############### set(planprivate_LIB_SRCS kptviewlistdocker.cpp kptviewlist.cpp kptviewlistdialog.cpp kptschedulesdocker.cpp kptconfig.cpp ConfigWorkVacationPanel.cpp ConfigProjectPanel.cpp kpttaskdefaultpanel.cpp kptworkpackageconfigpanel.cpp kptcolorsconfigpanel.cpp kptcontext.cpp kptfactory.cpp kptpart.cpp kptmaindocument.cpp kptview.cpp # KPtViewAdaptor.cpp kptprintingcontrolprivate.cpp kptschedulerpluginloader.cpp kptbuiltinschedulerplugin.cpp kptconfigskeleton.cpp kptinsertfiledlg.cpp about/aboutpage.cpp KPlatoXmlLoader.cpp ) ki18n_wrap_ui(planprivate_LIB_SRCS kptviewlistaddview.ui kptviewlisteditview.ui kptviewlisteditcategory.ui ConfigWorkVacationPanel.ui ConfigProjectPanel.ui kptconfigtaskpanelbase.ui kptworkpackageconfigpanel.ui kptcolorsconfigpanel.ui kptinsertfilepanel.ui ) kconfig_add_kcfg_files(plansettings_SRCS calligraplansettings.kcfgc) add_library(planprivate SHARED ${planprivate_LIB_SRCS} ${plansettings_SRCS} ) generate_export_header(planprivate BASE_NAME kplato) target_link_libraries(planprivate PUBLIC kplatokernel kplatomodels kplatoui komain PRIVATE koplugin KF5::IconThemes #KF5::KHtml ) if(KF5AkonadiContact_FOUND) target_link_libraries(planprivate PRIVATE KF5::AkonadiContact) endif() set_target_properties(planprivate PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} ) install(TARGETS planprivate ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### KPlato part ############### set(planpart_PART_SRCS kptfactoryinit.cpp ) add_library(calligraplanpart MODULE ${planpart_PART_SRCS}) calligra_part_desktop_to_json(calligraplanpart planpart.desktop) target_link_libraries(calligraplanpart KF5::Parts planprivate) install(TARGETS calligraplanpart DESTINATION ${PLUGIN_INSTALL_DIR}/calligra/parts) ########### KPlato executable ############### if(NOT RELEASE_BUILD) add_definitions(-DMAINTANER_WANTED_SPLASH) endif() set(calligraplan_KDEINIT_SRCS main.cpp ) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/*-apps-calligraplan.png") ecm_add_app_icon(calligraplan_KDEINIT_SRCS ICONS ${ICONS_SRCS}) kf5_add_kdeinit_executable( calligraplan ${calligraplan_KDEINIT_SRCS}) if (APPLE) set_target_properties(calligraplan PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.template) set_target_properties(calligraplan PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.calligra.plan") set_target_properties(calligraplan PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Plan") install( FILES ${CMAKE_CURRENT_BINARY_DIR}/calligraplan_KDEINIT_SRCS.icns DESTINATION ${BUNDLE_INSTALL_DIR}/calligraplan.app/Contents/Resources) endif () target_link_libraries(kdeinit_calligraplan komain) install(TARGETS kdeinit_calligraplan ${INSTALL_TARGETS_DEFAULT_ARGS}) target_link_libraries(calligraplan kdeinit_calligraplan komain) install(TARGETS calligraplan ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### install( FILES calligraplan.rc calligraplan_readonly.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/calligraplan) install( PROGRAMS org.kde.calligraplan.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) install( FILES calligraplanrc DESTINATION ${CONFIG_INSTALL_DIR}) install(FILES calligraplansettings.kcfg DESTINATION ${KCFG_INSTALL_DIR}) install(FILES org.kde.calligraplan.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # TODO: with the new embedded JSON data for plugins there is no schema ATM to define extended properties # plan_viewplugin.desktop install(FILES about/top-left-plan.png about/main.html about/intro.html about/tips.html about/tutorial.html about/plan.css DESTINATION ${DATA_INSTALL_DIR}/calligraplan/about ) diff --git a/libs/kernel/CMakeLists.txt b/libs/kernel/CMakeLists.txt index 619f1db9..afa63ae4 100644 --- a/libs/kernel/CMakeLists.txt +++ b/libs/kernel/CMakeLists.txt @@ -1,58 +1,60 @@ -add_subdirectory( tests ) +if(BUILD_TESTING) + add_subdirectory( tests ) +endif() include_directories(${KOODF_INCLUDES} ${CMAKE_SOURCE_DIR}/libs/widgetutils ${KUNDO2_INCLUDES}) ########### KPlato kernel library ############### set(kplatokernel_LIB_SRCS kptglobal.cpp kptlocale.cpp kpteffortcostmap.cpp kptdocuments.cpp kptaccount.cpp kptappointment.cpp kptnode.cpp kptproject.cpp kptrelation.cpp kptresource.cpp kpttask.cpp kptduration.cpp kptdatetime.cpp kptcalendar.cpp kptschedule.cpp kptwbsdefinition.cpp kptcommand.cpp kptpackage.cpp kptdebug.cpp kptschedulerplugin.cpp kptconfigbase.cpp KPlatoXmlLoaderBase.cpp ) add_library(kplatokernel SHARED ${kplatokernel_LIB_SRCS}) generate_export_header(kplatokernel) target_link_libraries(kplatokernel PUBLIC koodf kowidgetutils kundo2 KF5::KIOWidgets ) if(KF5Holidays_FOUND) target_link_libraries(kplatokernel PUBLIC KF5::Holidays) endif() set_target_properties(kplatokernel PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} ) install(TARGETS kplatokernel ${INSTALL_TARGETS_DEFAULT_ARGS}) # TODO: with the new embedded JSON data for plugins there is no schema ATM to define extended properties # plan_schedulerplugin.desktop diff --git a/libs/models/CMakeLists.txt b/libs/models/CMakeLists.txt index eed57ab4..3e5066bf 100644 --- a/libs/models/CMakeLists.txt +++ b/libs/models/CMakeLists.txt @@ -1,71 +1,73 @@ -add_subdirectory( tests ) +if(BUILD_TESTING) + add_subdirectory( tests ) +endif() include_directories( ../kernel ${CMAKE_SOURCE_DIR}/libs/widgetutils ${KOODF_INCLUDES} ${KUNDO2_INCLUDES} ) if (KF5Contacts_FOUND) add_definitions(-DPLAN_KCONTACTS_FOUND) endif () ########### KPlato data models library ############### set(kplatomodels_LIB_SRCS reportgenerator/ReportGenerator.cpp reportgenerator/ReportGeneratorOdt.cpp kptcommonstrings.cpp kpttreecombobox.cpp kcalendar/kdatetable.cpp kcalendar/kdatepicker.cpp kptnodechartmodel.cpp kptflatproxymodel.cpp kptrelationmodel.cpp kptworkpackagemodel.cpp kptdocumentmodel.cpp kptitemmodelbase.cpp kptnodeitemmodel.cpp kptdurationspinbox.cpp kpttaskstatusmodel.cpp kptresourcemodel.cpp kptcalendarmodel.cpp kptschedulemodel.cpp kptaccountsmodel.cpp kptpertcpmmodel.cpp kptresourceappointmentsmodel.cpp kptresourceallocationmodel.cpp kpttaskcompletedelegate.cpp ) add_library(kplatomodels SHARED ${kplatomodels_LIB_SRCS}) generate_export_header(kplatomodels) target_link_libraries(kplatomodels PUBLIC kplatokernel koodf kundo2 KChart KF5::KIOWidgets PRIVATE KGantt KF5::Notifications KF5::TextWidgets ) if(KF5Contacts_FOUND) target_link_libraries(kplatomodels PRIVATE KF5::Contacts) endif() set_target_properties(kplatomodels PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} ) install(TARGETS kplatomodels ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/plugins/schedulers/rcps/CMakeLists.txt b/plugins/schedulers/rcps/CMakeLists.txt index 713cd4d3..8fd83c2b 100644 --- a/plugins/schedulers/rcps/CMakeLists.txt +++ b/plugins/schedulers/rcps/CMakeLists.txt @@ -1,24 +1,26 @@ add_definitions(-DTRANSLATION_DOMAIN=\"calligraplan_scheduler_rcps\") set(LIBRCPS_INCLUDE_DIR 3rdparty/LibRCPS/src) include_directories( ${LIBRCPS_INCLUDE_DIR} ${KOODF_INCLUDES} ${CMAKE_SOURCE_DIR}/plan/libs/kernel ) add_subdirectory( 3rdparty ) -add_subdirectory( tests ) +if(BUILD_TESTING) + add_subdirectory( tests ) +endif() set ( RCPSScheduler_SRCS KPlatoRCPSPlugin.cpp KPlatoRCPSScheduler.cpp ) add_library(kplatorcpsscheduler MODULE ${RCPSScheduler_SRCS} ) calligraplan_scheduler_desktop_to_json(kplatorcpsscheduler planrcpsscheduler.desktop) target_link_libraries( kplatorcpsscheduler kplatokernel rcps_plan # ${LIBRCPS_LIBRARIES} ) install( TARGETS kplatorcpsscheduler DESTINATION ${PLUGIN_INSTALL_DIR}/calligraplan/schedulers ) diff --git a/plugins/schedulers/tj/CMakeLists.txt b/plugins/schedulers/tj/CMakeLists.txt index 60f042b2..147155b8 100644 --- a/plugins/schedulers/tj/CMakeLists.txt +++ b/plugins/schedulers/tj/CMakeLists.txt @@ -1,51 +1,53 @@ add_definitions(-DTRANSLATION_DOMAIN=\"calligraplan_scheduler_tj\") set(LIBTJ_INCLUDE_DIR taskjuggler) include_directories( ${LIBTJ_INCLUDE_DIR} ${KOODF_INCLUDES} ${CMAKE_SOURCE_DIR}/plan/libs/kernel ) #add_subdirectory( taskjuggler ) -add_subdirectory( tests ) +if(BUILD_TESTING) + add_subdirectory( tests ) +endif() set ( TJScheduler_SRCS PlanTJPlugin.cpp PlanTJScheduler.cpp taskjuggler/Allocation.cpp taskjuggler/CoreAttributes.cpp taskjuggler/CoreAttributesList.cpp taskjuggler/Project.cpp taskjuggler/Task.cpp taskjuggler/TaskDependency.cpp taskjuggler/TaskList.cpp taskjuggler/TaskScenario.cpp taskjuggler/Resource.cpp taskjuggler/ResourceList.cpp taskjuggler/Scenario.cpp taskjuggler/ScenarioList.cpp taskjuggler/Shift.cpp taskjuggler/ShiftList.cpp taskjuggler/ShiftSelection.cpp taskjuggler/ShiftSelectionList.cpp taskjuggler/VacationList.cpp taskjuggler/TjMessageHandler.cpp taskjuggler/Utility.cpp # taskjuggler/XMLFile.cpp # taskjuggler/ParserElement.cpp # taskjuggler/ParserNode.cpp # taskjuggler/ParserTreeContext.cpp taskjuggler/Interval.cpp ) # TODO: plugin should not be SHARED, but MODULE. Needs to be SHARED because tests link to it -> fix with util lib/objects add_library(plantjscheduler SHARED ${TJScheduler_SRCS} ) calligraplan_scheduler_desktop_to_json(plantjscheduler plantjscheduler.desktop) # TODO: only export symbols for tests, not release generate_export_header(plantjscheduler BASE_NAME kplatotj) target_link_libraries( plantjscheduler kplatokernel ) set_target_properties( plantjscheduler PROPERTIES DEFINE_SYMBOL MAKE_KPLATOTJ_LIB ) install( TARGETS plantjscheduler DESTINATION ${PLUGIN_INSTALL_DIR}/calligraplan/schedulers ) diff --git a/plugins/scripting/CMakeLists.txt b/plugins/scripting/CMakeLists.txt index 69ac34b3..e79cc24c 100644 --- a/plugins/scripting/CMakeLists.txt +++ b/plugins/scripting/CMakeLists.txt @@ -1,47 +1,49 @@ add_definitions(-DTRANSLATION_DOMAIN=\"krossmoduleplan\") include_directories( ${CMAKE_SOURCE_DIR}/plan ${KPLATO_INCLUDES} ${KOKROSS_INCLUDES} ) add_subdirectory( scripts ) -add_subdirectory( tests ) +if(BUILD_TESTING) + add_subdirectory( tests ) +endif() set(krossmoduleplan_PART_SRCS Account.cpp Calendar.cpp Node.cpp Resource.cpp ResourceGroup.cpp Schedule.cpp Project.cpp Module.cpp ScriptingPart.cpp ScriptingWidgets.cpp ScriptingDebug.cpp ) ki18n_wrap_ui(krossmoduleplan_PART_SRCS ScriptingDataQueryView.ui ) # TODO: plugin should not be SHARED, but MODULE. Needs to be SHARED because tests link to it -> fix with util lib/objects add_library(krossmoduleplan SHARED ${krossmoduleplan_PART_SRCS}) generate_export_header(krossmoduleplan BASE_NAME kplatoscripting EXPORT_FILE_NAME kplatoscripting_generated_export.h ) calligraplan_viewplugin_desktop_to_json(krossmoduleplan planscripting.desktop) target_link_libraries(krossmoduleplan planprivate kplatokernel kplatomodels komain kokross ) install(TARGETS krossmoduleplan DESTINATION ${PLUGIN_INSTALL_DIR}/calligraplan/extensions) install(FILES scripting.rc DESTINATION ${DATA_INSTALL_DIR}/calligraplan/viewplugins)