[cmake-developers] [CMake 0012224]: FindPerlLibs.cmake fails to find PERL_LIBRARY on Windows
Mantis Bug Tracker
mantis at public.kitware.com
Wed May 25 15:47:30 EDT 2011
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=12224
======================================================================
Reported By: Jeff Trull
Assigned To:
======================================================================
Project: CMake
Issue ID: 12224
Category: Modules
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2011-05-25 15:47 EDT
Last Modified: 2011-05-25 15:47 EDT
======================================================================
Summary: FindPerlLibs.cmake fails to find PERL_LIBRARY on
Windows
Description:
The PERL_LIBRARY (should be a path to perl512.lib) is not successfully found
with the current code, although the executable and include paths are found OK.
Under Linux (Ubuntu 10.10) it works fine for all three.
Steps to Reproduce:
Put find_package(PerlLibs REQUIRED) into a CMakeLists.txt file and run cmake
under Windows 7 with ActivePerl 5.12 installed.
Additional Information:
This issue appears to have been first reported by Hugh Sorby in 2009:
http://comments.gmane.org/gmane.comp.programming.tools.cmake.user/25824
The problem seems to be due to:
1) '${PERL_EXECUTABLE} -V:libperl' output ends in a CRLF pair under windows, and
at least part of that remains in the library filename being searched for
2) Under Windows ${PERL_ARCHLIB} looks like "C:\Perl\lib", so
${PERL_ARCHLIB}/CORE looks like "C:\Perl\lib/CORE", which I believe is confusing
find_library()
My solution (patch attached) is:
1) Use the OUTPUT_STRIP_TRAILING_WHITESPACE option when ${PERL_EXECUTABLE} is
called
2) Remove the loop where each of the ${PERL_POSSIBLE_LIB_PATHS} is prepended to
the ${PERL_POSSIBLE_LIBRARY_NAME} values. Given that PERL_POSSIBLE_LIB_PATHS is
supplied as the PATHS argument to find_library, this seems unnecessary and also
results in the above issue.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2011-05-25 15:47 Jeff Trull New Issue
2011-05-25 15:47 Jeff Trull File Added: FindPerlLibs_win.patch
======================================================================
More information about the cmake-developers
mailing list