[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim/KDE/4.14] korganizer: [korganizer] cmake discovery for Perl needed for ical2vcal
From: Allen Winter <winter () kde ! org>
Date: 2015-08-31 21:02:36
Message-ID: E1ZWWDs-0007Eu-CA () scm ! kde ! org
[Download RAW message or body]
Git commit 1e9e4eff42ac3974e2b012ba135b3b40224de0b6 by Allen Winter.
Committed on 31/08/2015 at 20:57.
Pushed by winterz into branch 'KDE/4.14'.
[korganizer] cmake discovery for Perl needed for ical2vcal
if Perl not found, then no menu item for "Import UNIX Ical Tool"
CCBUG: 351750
MERGE: Discuss in Phabricator Task. IMO: let's remove this
M +19 -11 korganizer/CMakeLists.txt
M +2 -2 korganizer/actionmanager.cpp
http://commits.kde.org/kdepim/1e9e4eff42ac3974e2b012ba135b3b40224de0b6
diff --git a/korganizer/CMakeLists.txt b/korganizer/CMakeLists.txt
index 144ea59..4ba1e84 100644
--- a/korganizer/CMakeLists.txt
+++ b/korganizer/CMakeLists.txt
@@ -1,9 +1,12 @@
project(korganizer)
-add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5850)
-add_definitions( -DQT_NO_CAST_FROM_ASCII )
-add_definitions( -DQT_NO_CAST_TO_ASCII )
+# Perl is needed for ical2vcal
+find_package(Perl)
+set_package_properties(Perl PROPERTIES DESCRIPTION "The Perl language interpreter" \
URL "http://www.perl.org" TYPE OPTIONAL PURPOSE "Needed for the ICal 2 VCal import \
tool")
+add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5850)
+add_definitions(-DQT_NO_CAST_FROM_ASCII)
+add_definitions(-DQT_NO_CAST_TO_ASCII)
# enable exception handling
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
@@ -34,10 +37,13 @@ if(KDEPIM_BUILD_DESKTOP)
add_subdirectory(kcmconfigs)
endif()
-set(PERL ${PERL_EXECUTABLE})
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/data/ical2vcal.cmake \
${CMAKE_CURRENT_BINARY_DIR}/ical2vcal @ONLY
-)
+if(PERL_FOUND)
+ add_definitions(-DHAVE_PERL)
+ set(PERL ${PERL_EXECUTABLE})
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/data/ical2vcal.cmake \
${CMAKE_CURRENT_BINARY_DIR}/ical2vcal @ONLY + )
+endif()
########### next target ###############
@@ -333,9 +339,11 @@ set(korganizerprivate_LIB_SRCS
DESTINATION ${XDG_APPS_INSTALL_DIR}
)
- install(PROGRAMS
- ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal
- DESTINATION ${BIN_INSTALL_DIR}
- )
+ if(PERL_FOUND)
+ install(PROGRAMS
+ ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal
+ DESTINATION ${BIN_INSTALL_DIR}
+ )
+ endif()
endif()
diff --git a/korganizer/actionmanager.cpp b/korganizer/actionmanager.cpp
index 482d64b..90fc7a5 100644
--- a/korganizer/actionmanager.cpp
+++ b/korganizer/actionmanager.cpp
@@ -287,6 +287,7 @@ void ActionManager::initActions()
mACollection->addAction( QLatin1String("import_icalendar"), mImportAction );
connect( mImportAction, SIGNAL(triggered(bool)), SLOT(file_import()) );
+#if defined(HAVE_PERL)
KAction *importAction = new KAction( i18n( "&Import From UNIX Ical Tool" ), this \
); importAction->setHelpText(
i18n( "Import a calendar in another format" ) );
@@ -295,7 +296,7 @@ void ActionManager::initActions()
"of a non-iCalendar formatted file into your current calendar." ) );
mACollection->addAction( QLatin1String("import_ical"), importAction );
connect( importAction, SIGNAL(triggered(bool)), SLOT(file_icalimport()) );
-
+#endif
action = new KAction( i18n( "Get &Hot New Stuff..." ), this );
mACollection->addAction( QLatin1String("downloadnewstuff"), action );
connect( action, SIGNAL(triggered(bool)), SLOT(downloadNewStuff()) );
@@ -1970,4 +1971,3 @@ void ActionManager::handleExportJobResult( KJob *job )
delete htmlExportJob->settings();
}
}
-
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic