From cd5944689c433398def5141ff5ef255e02b3b519 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 30 Apr 2017 17:36:42 -0400 Subject: [PATCH] Use find_package() to find Perl, and run it earlier Previously, PERL_EXECUTABLE was set manually in library/CMakeLists.txt, which caused gunzip.pl to fail if was run before that happened. --- CMakeLists.txt | 2 ++ library/CMakeLists.txt | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 615ce4e95..186fabf4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,8 @@ IF(CMAKE_CROSSCOMPILING) INCLUDE("${DFHACK_NATIVE_BUILD_DIR}/ImportExecutables.cmake") ENDIF() +find_package(Perl REQUIRED) + # set up folder structures for IDE solutions # MSVC Express won't load solutions that use this. It also doesn't include MFC supported # Check for MFC! diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 9f8477993..7a296dbc7 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -16,8 +16,6 @@ ENDIF() include_directories (proto) include_directories (include) -SET(PERL_EXECUTABLE "perl" CACHE FILEPATH "This is the perl executable to run in the codegen step. Tweak it if you need to run a specific one.") - execute_process(COMMAND ${PERL_EXECUTABLE} xml/list.pl xml ${dfapi_SOURCE_DIR}/include/df ";" WORKING_DIRECTORY ${dfapi_SOURCE_DIR} OUTPUT_VARIABLE GENERATED_HDRS)