summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-05 10:54:48 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-05 10:54:48 (GMT)
commit6fca7438f1d27b949015f366b65ec9e23ad2296b (patch)
treeba1817b831740748fa426435169c130c717e3960
parent9f3e8511d9d92f41d3cfc01454b10c97fcc292ff (diff)
cmake: use find_program for cli executables
cmake can look for a given executable with the `find_program` macro. We can use it to print warnings in the cmake output when an executable is not installed. Differential Revision: D3198
-rw-r--r--plugins/cli7zplugin/CMakeLists.txt7
-rw-r--r--plugins/clirarplugin/CMakeLists.txt14
-rw-r--r--plugins/cliunarchiverplugin/CMakeLists.txt7
-rw-r--r--plugins/clizipplugin/CMakeLists.txt14
-rw-r--r--plugins/libarchive/CMakeLists.txt7
5 files changed, 49 insertions, 0 deletions
diff --git a/plugins/cli7zplugin/CMakeLists.txt b/plugins/cli7zplugin/CMakeLists.txt
index 0b127e4..58e17a5 100644
--- a/plugins/cli7zplugin/CMakeLists.txt
+++ b/plugins/cli7zplugin/CMakeLists.txt
@@ -23,3 +23,10 @@ kerfuffle_add_plugin(kerfuffle_cli7z ${kerfuffle_cli7z_SRCS})
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLI7Z_MIMETYPES}" PARENT_SCOPE)
set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_cli7z;" PARENT_SCOPE)
+
+find_program(P7ZIP 7z)
+if(P7ZIP)
+ message(STATUS "Found p7zip executable: ${P7ZIP}")
+else()
+ message(WARNING "Could not find the 7z executable. Ark won't be able to handle the 7z archive format.")
+endif()
diff --git a/plugins/clirarplugin/CMakeLists.txt b/plugins/clirarplugin/CMakeLists.txt
index 50f2bce..cb769f5 100644
--- a/plugins/clirarplugin/CMakeLists.txt
+++ b/plugins/clirarplugin/CMakeLists.txt
@@ -24,3 +24,17 @@ kerfuffle_add_plugin(kerfuffle_clirar ${kerfuffle_clirar_SRCS})
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLIRAR_MIMETYPES}" PARENT_SCOPE)
set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_clirar;" PARENT_SCOPE)
+
+find_program(UNRAR unrar)
+if(UNRAR)
+ message(STATUS "Found unrar executable: ${UNRAR}")
+else()
+ message(WARNING "Could not find the unrar executable. Ark requires unrar or unar to extract RAR archives.")
+endif()
+
+find_program(RAR rar)
+if(RAR)
+ message(STATUS "Found rar executable: ${RAR}")
+else()
+ message(WARNING "Could not find the rar executable. Ark won't be able to create or edit RAR archives.")
+endif()
diff --git a/plugins/cliunarchiverplugin/CMakeLists.txt b/plugins/cliunarchiverplugin/CMakeLists.txt
index b38fcd8..9068856 100644
--- a/plugins/cliunarchiverplugin/CMakeLists.txt
+++ b/plugins/cliunarchiverplugin/CMakeLists.txt
@@ -25,3 +25,10 @@ kerfuffle_add_plugin(kerfuffle_cliunarchiver ${kerfuffle_cliunarchiver_SRCS})
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLIUNARCHIVER_MIMETYPES}"
PARENT_SCOPE)
set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_cliunarchiver;" PARENT_SCOPE)
+
+find_program(UNAR unar)
+if(UNAR)
+ message(STATUS "Found unar executable: ${UNAR}")
+else()
+ message(WARNING "Could not find the unar executable. Ark requires unar or unrar to extract RAR archives.")
+endif()
diff --git a/plugins/clizipplugin/CMakeLists.txt b/plugins/clizipplugin/CMakeLists.txt
index a2c5eec..70e3e7a 100644
--- a/plugins/clizipplugin/CMakeLists.txt
+++ b/plugins/clizipplugin/CMakeLists.txt
@@ -23,3 +23,17 @@ kerfuffle_add_plugin(kerfuffle_clizip ${kerfuffle_clizip_SRCS})
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLIZIP_MIMETYPES}" PARENT_SCOPE)
set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_clizip;" PARENT_SCOPE)
+
+find_program(UNZIP unzip)
+if(UNZIP)
+ message(STATUS "Found unzip executable: ${UNZIP}")
+else()
+ message(WARNING "Could not find the unzip executable. Ark requires unzip or 7z to extract zip archives.")
+endif()
+
+find_program(ZIP zip)
+if(ZIP)
+ message(STATUS "Found zip executable: ${ZIP}")
+else()
+ message(WARNING "Could not find the zip executable. Ark requires zip or 7z to create or edit zip archives.")
+endif()
diff --git a/plugins/libarchive/CMakeLists.txt b/plugins/libarchive/CMakeLists.txt
index 0d81973..97c65fe 100644
--- a/plugins/libarchive/CMakeLists.txt
+++ b/plugins/libarchive/CMakeLists.txt
@@ -84,3 +84,10 @@ set(INSTALLED_LIBARCHIVE_PLUGINS "${INSTALLED_LIBARCHIVE_PLUGINS}kerfuffle_libar
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES}${SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES}" PARENT_SCOPE)
set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}${INSTALLED_LIBARCHIVE_PLUGINS}" PARENT_SCOPE)
+
+find_program(LRZIP lrzip)
+if(LRZIP)
+ message(STATUS "Found lrzip executable: ${LRZIP}")
+else()
+ message(WARNING "Could not find the lrzip executable. Ark requires lrzip to handle the tar.lrz archive format.")
+endif()