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.
develop
lethosor 2017-04-30 17:36:42 -04:00
parent 63b70891af
commit cd5944689c
2 changed files with 2 additions and 2 deletions

@ -94,6 +94,8 @@ IF(CMAKE_CROSSCOMPILING)
INCLUDE("${DFHACK_NATIVE_BUILD_DIR}/ImportExecutables.cmake") INCLUDE("${DFHACK_NATIVE_BUILD_DIR}/ImportExecutables.cmake")
ENDIF() ENDIF()
find_package(Perl REQUIRED)
# set up folder structures for IDE solutions # set up folder structures for IDE solutions
# MSVC Express won't load solutions that use this. It also doesn't include MFC supported # MSVC Express won't load solutions that use this. It also doesn't include MFC supported
# Check for MFC! # Check for MFC!

@ -16,8 +16,6 @@ ENDIF()
include_directories (proto) include_directories (proto)
include_directories (include) 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 ";" execute_process(COMMAND ${PERL_EXECUTABLE} xml/list.pl xml ${dfapi_SOURCE_DIR}/include/df ";"
WORKING_DIRECTORY ${dfapi_SOURCE_DIR} WORKING_DIRECTORY ${dfapi_SOURCE_DIR}
OUTPUT_VARIABLE GENERATED_HDRS) OUTPUT_VARIABLE GENERATED_HDRS)