<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
O/H Alexander Neundorf έγραψε:
<blockquote cite="mid:200807061115.45595.a.neundorf-work@gmx.net"
type="cite">
<pre wrap="">On Monday 30 June 2008, Georgios Petasis wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
I am running cmake 2.6 under windows:
MESSAGE ( STATUS "Searching for Perl..." )
FIND_PACKAGE ( Perl )
FIND_PACKAGE ( PerlLibs )
IF ( PERL_FOUND )
MESSAGE ( STATUS " PERL_EXECUTABLE: " ${PERL_EXECUTABLE} )
MESSAGE ( STATUS " PERL_INCLUDE_PATH: " ${PERL_INCLUDE_PATH} )
MESSAGE ( STATUS " PERL_LIBRARY: " ${PERL_LIBRARY} )
ENDIF ( PERL_FOUND )
The output is:
-- Searching for Perl...
-- Found Perl: C:/Program Files (x86)/Perl/bin/perl.exe
-- Could NOT find PerlLibs
-- PERL_EXECUTABLE: C:/Program Files (x86)/Perl/bin/perl.exe
-- PERL_INCLUDE_PATH: PERL_INCLUDE_PATH-NOTFOUND
-- PERL_LIBRARY: PERL_LIBRARY-NOTFOUND
It seems that it can locate perl (which is also in the PATH), but not
its libs. Can I fix this?
</pre>
</blockquote>
<pre wrap=""><!---->
Please have a look at FindPerlLibs.cmake and add some MESSAGE(STATUS ...) to
find out what is going on exactly. Is it simply the version number which is
missing ?
Alex</pre>
</blockquote>
Dear Alex,<br>
<br>
I have solved this problem by not making adjustments to cmake files, as
I have to support computers <br>
with a default cmake installation. Instead, I have put the following
code in my CMakeLists.txt:<br>
<br>
<tt> EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}<br>
-MConfig -e "print \$Config{version}"<br>
OUTPUT_VARIABLE PERL_OUTPUT<br>
RESULT_VARIABLE PERL_RETURN_VALUE )<br>
IF ( NOT PERL_RETURN_VALUE )<br>
SET ( PERL_VERSION ${PERL_OUTPUT} )<br>
ENDIF ( NOT PERL_RETURN_VALUE )<br>
<br>
## Try to fix failure in PERL_INCLUDE_PATH<br>
IF ( PERL_INCLUDE_PATH MATCHES .*-NOTFOUND )<br>
EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}<br>
-MConfig -e "print \$Config{archlibexp}"<br>
OUTPUT_VARIABLE PERL_OUTPUT<br>
RESULT_VARIABLE PERL_RETURN_VALUE )<br>
IF ( NOT PERL_RETURN_VALUE )<br>
FIND_PATH ( PERL_INCLUDE_PATH perl.h ${PERL_OUTPUT}/CORE )<br>
ENDIF ( NOT PERL_RETURN_VALUE )<br>
ENDIF ( PERL_INCLUDE_PATH MATCHES .*-NOTFOUND )<br>
## Try to fix failure in PERL_LIBRARY<br>
IF ( PERL_LIBRARY MATCHES .*-NOTFOUND )<br>
EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}<br>
-MConfig -e "print \$Config{libperl}"<br>
OUTPUT_VARIABLE PERL_OUTPUT<br>
RESULT_VARIABLE PERL_RETURN_VALUE )<br>
IF ( NOT PERL_RETURN_VALUE )<br>
FIND_LIBRARY ( PERL_LIBRARY NAMES ${PERL_OUTPUT}<br>
PATHS ${PERL_INCLUDE_PATH} )<br>
ENDIF ( NOT PERL_RETURN_VALUE )<br>
ENDIF ( PERL_LIBRARY MATCHES .*-NOTFOUND )<br>
MESSAGE ( STATUS " PERL_VERSION: " ${PERL_VERSION} )<br>
MESSAGE ( STATUS " PERL_EXECUTABLE: " ${PERL_EXECUTABLE} )<br>
MESSAGE ( STATUS " PERL_INCLUDE_PATH: " ${PERL_INCLUDE_PATH} )<br>
MESSAGE ( STATUS " PERL_LIBRARY: " ${PERL_LIBRARY} )<br>
</tt><br>
But, now my problem is different: I do have perl found, but I cannot
convince cmake to build my code right.<br>
It seems that an improper linker switch is added automatically by
cmake, but I am unable to find somewhere the exact link statement that
is executed by cmake. All options are written in a temp file, which is
written/deleted instantly.<br>
Any idea on how I can see its contents?<br>
<br>
Currently the only way to build my code is with my hand-written
makefile :-(<br>
I have been trying to resolve this problem with cmake for more than 5
days.<br>
I still have no clue what cmake adds, but makes global symbols in my
dll & the perl library different symbols,<br>
so perl cannot update its global structures...<br>
<br>
Best regards,<br>
<br>
George<br>
</body>
</html>