Commit 6fca7438 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

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
parent 9f3e8511
......@@ -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()
......@@ -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()
......@@ -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()
......@@ -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()
......@@ -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()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment