# #Perl script interpreter # if (WIN32) #Perl is not expected to be present on WIN32. #Build from sources and install where find_package(perl) will find it. #We take care to use a Perl release that will build with as many versions of #Visual Studio as possible. #Ancient Visual Studio which will be used to build Perl by default set (PERL_CCTYPE MSVC60) #If the Visual Studio detected by CMake is more recent, use it #Visual Studio 2003 if (MSVC_VERSION EQUAL 1310) set (PERL_CCTYPE MSVC70FREE) message (STATUS "Building Perl with Visual Studio 2003") endif (MSVC_VERSION EQUAL 1310) #Visual Studio 2005 if (MSVC_VERSION EQUAL 1400) set (PERL_CCTYPE MSVC80FREE) message (STATUS "Building Perl with Visual Studio 2005") endif (MSVC_VERSION EQUAL 1400) #Visual Studio 2008 if (MSVC_VERSION EQUAL 1500) set (PERL_CCTYPE MSVC90FREE) message (STATUS "Building Perl with Visual Studio 2008") endif (MSVC_VERSION EQUAL 1500) #Visual Studio 2010 if (MSVC_VERSION EQUAL 1600) set (PERL_CCTYPE MSVC100FREE) message (STATUS "Building Perl with Visual Studio 2010") endif (MSVC_VERSION EQUAL 1600) #Visual Studio 2012 if (MSVC_VERSION EQUAL 1700) set (PERL_CCTYPE MSVC110FREE) message (STATUS "Building Perl with Visual Studio 2012") endif (MSVC_VERSION EQUAL 1700) #Visual Studio 2013 if (MSVC_VERSION EQUAL 1800) set (PERL_CCTYPE MSVC120FREE) message (STATUS "Building Perl with Visual Studio 2013") endif (MSVC_VERSION EQUAL 1800) #Visual Studio 2015 if (MSVC_VERSION EQUAL 1900) set (PERL_CCTYPE MSVC140FREE) message (STATUS "Building Perl with Visual Studio 2015") endif (MSVC_VERSION EQUAL 1900) ExternalProject_Add ( perl PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 URL https://github.com/Perl/perl5/archive/v5.25.10.zip DOWNLOAD_NAME perl-5.25.10.zip URL_MD5 f4ed14617211db52cfcdacd978001d78 CONFIGURE_COMMAND "" BUILD_COMMAND ${CMAKE_COMMAND} -E chdir win32 nmake INST_TOP=$> CCTYPE=${PERL_CCTYPE} install INSTALL_COMMAND "" ) endif (WIN32) if (UNIX) #Rely on manual installation via the package manager #You can then invoke perl as /usr/bin/perl #sudo apt-get install perl ExternalProject_Add ( perl PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 DOWNLOAD_COMMAND "" UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND /usr/bin/perl --version INSTALL_COMMAND "" ) endif (UNIX)