summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-01-17 01:40:53 +0100
committerJulian Andres Klode <jak@debian.org>2017-01-17 01:43:50 +0100
commit1dcd7d291be1d39127c4b95778549f323e61ef15 (patch)
tree41bf9099867ffcfd5900250862ab008b9da959e3 /CMakeLists.txt
parent6ede8952f55a1bc356b42b1adc7b9bd504af943c (diff)
CMake: Find the Perl executable, and use it to run perl scripts
This is somewhat more portable than just hardcoding perl or in the triehash case /usr/bin/perl in the shebang. Thanks: Guillem Jover for the hint Gbp-Dch: ignore
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f40e389ae..99ee6b72b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,8 @@ find_package(Threads)
find_package(LFS REQUIRED)
find_package(Iconv REQUIRED)
+find_package(Perl REQUIRED)
+
if(USE_NLS)
find_package(Intl REQUIRED)
link_libraries(${Intl_LIBRARIES})
@@ -173,7 +175,7 @@ set(PACKAGE_MAIL "APT Development Team <deity@lists.debian.org>")
set(PACKAGE_VERSION "1.4~beta3")
if (NOT DEFINED DPKG_DATADIR)
- execute_process(COMMAND perl -MDpkg -e "print $Dpkg::DATADIR;"
+ execute_process(COMMAND ${PERL_EXECUTABLE} -MDpkg -e "print $Dpkg::DATADIR;"
OUTPUT_VARIABLE DPKG_DATADIR_CMD OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Found dpkg data dir: ${DPKG_DATADIR_CMD}")
set(DPKG_DATADIR "${DPKG_DATADIR_CMD}" CACHE PATH "dpkg data directory")