qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcpie...@apache.org
Subject svn commit: r1547578 - /qpid/proton/trunk/proton-c/bindings/perl/CMakeLists.txt
Date Tue, 03 Dec 2013 20:40:15 GMT
Author: mcpierce
Date: Tue Dec  3 20:40:15 2013
New Revision: 1547578

URL: http://svn.apache.org/r1547578
Log:
PROTON-445: Perl install now honors CMAKE_INSTALL_PREFIX

The language bindings will now honor this prefix, both the default
value and a user-specified value.

Developers can override it, though, by specifying PERL_INSTALL_PREFIX
at the command line as well. This will allow for installing the Perl
bindings to a different directory if so desired.

Also updated the installation pieces in CMake to simplify it.

Modified:
    qpid/proton/trunk/proton-c/bindings/perl/CMakeLists.txt

Modified: qpid/proton/trunk/proton-c/bindings/perl/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/perl/CMakeLists.txt?rev=1547578&r1=1547577&r2=1547578&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/perl/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/perl/CMakeLists.txt Tue Dec  3 20:40:15 2013
@@ -22,15 +22,63 @@ include_directories("${PERL_INCLUDE_PATH
 # Need to pass in the same compiler flags used to build Perl itself
 execute_process(COMMAND perl -MConfig -e "print \$Config{ccflags}"
                 OUTPUT_VARIABLE PERLCFLAGS)
-if (NOT PERL_VENDORLIB)
-  execute_process(COMMAND perl -V:installvendorlib
-                  OUTPUT_VARIABLE PERL_VENDORLIB_OUTPUT_VARIABLE
-                  RESULT_VARIABLE PERL_VENDORLIB_RESULT_VARIABLE)
-  if (NOT PERL_VENDORLIB_RESULT_VARIABLE)
-      string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
-      file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
-  endif (NOT PERL_VENDORLIB_RESULT_VARIABLE)
-endif (NOT PERL_VENDORLIB)
+if (NOT PERL_INSTALL_PREFIX)
+  set(PERL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
+endif (NOT PERL_INSTALL_PREFIX)
+
+execute_process(COMMAND perl -V:prefix
+  OUTPUT_VARIABLE PERL_PREFIX
+)
+
+string(REGEX REPLACE
+  "[a-z]+='([^']+)'.*"
+  "\\1"
+  PERL_PREFIX
+  ${PERL_PREFIX}
+)
+
+# get the Perl vendor lib directory
+execute_process(COMMAND perl -V:installvendorlib
+  OUTPUT_VARIABLE PERL_VENDORLIB_OUTPUT_VARIABLE
+  RESULT_VARIABLE PERL_VENDORLIB_RESULT_VARIABLE)
+
+string(REGEX REPLACE
+  "(.*)${PERL_PREFIX}(.*)"
+  "\\1${PERL_INSTALL_PREFIX}\\2"
+  PERL_VENDORLIB_OUTPUT_VARIABLE
+  "${PERL_VENDORLIB_OUTPUT_VARIABLE}"
+)
+
+string(REGEX REPLACE
+  "install[a-z]+='([^']+)'.*"
+  "\\1"
+  PERL_VENDORLIB
+  ${PERL_VENDORLIB_OUTPUT_VARIABLE}
+)
+
+file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
+
+# get the Perl arch lib directory
+
+execute_process(COMMAND perl -V:installarchlib
+  OUTPUT_VARIABLE PERL_ARCHLIB_OUTPUT_VARIABLE
+  RESULT_VARIABLE PERL_ARCHLIB_RESULT_VARIABLE)
+
+string(REGEX REPLACE
+  "(.*)${PERL_PREFIX}(.*)"
+  "\\1${PERL_INSTALL_PREFIX}\\2"
+  PERL_ARCHLIB_OUTPUT_VARIABLE
+  "${PERL_ARCHLIB_OUTPUT_VARIABLE}"
+)
+
+string(REGEX REPLACE
+  "install[a-z]+='([^']+)'.*"
+  "\\1"
+  PERL_ARCHLIB
+  ${PERL_ARCHLIB_OUTPUT_VARIABLE}
+)
+
+file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
 
 set (CMAKE_C_FLAGS ${PERLCFLAGS})
 
@@ -50,34 +98,14 @@ else()
         )
 endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
 
-set(PERL_LIBRARIES
-    lib/qpid/proton/array_helper.pm
-    lib/qpid/proton/Constants.pm
-    lib/qpid/proton/Data.pm
-    lib/qpid/proton/Mapping.pm
-    lib/qpid/proton/Message.pm
-    lib/qpid/proton/Messenger.pm
-)
-
-# get the perl vendor library if it's not already defined
-#if (NOT PERL_VENDORLIB)
-#  execute_process(COMMAND ${PERL_EXECUTABLE} "-V:installvendorlib"
-#                  OUTPUT_VARIABLE PERL_VENDORLIB_OUTPUT_VARIABLE
-#                  RESULT_VARIABLE PERL_VENDORLIB_RESULT_VARIABLE)
-#endif (!DEFINED PERL_VENDORLIB)
-
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton_perl.pm
         DESTINATION ${PERL_ARCHLIB}
         COMPONENT Perl)
 
-install(FILES lib/qpid_proton.pm
+install(DIRECTORY lib/qpid
         DESTINATION ${PERL_VENDORLIB}
         COMPONENT Perl)
 
-INSTALL(FILES lib/qpid/proton.pm
-        DESTINATION ${PERL_VENDORLIB}/qpid
-        COMPONENT Perl)
-
-INSTALL(FILES ${PERL_LIBRARIES}
-        DESTINATION ${PERL_VENDORLIB}/qpid/proton
-        COMPONENT Perl)
+install(FILES lib/qpid_proton.pm
+  DESTINATION ${PERL_VENDORLIB}
+  COMPONENT Perl)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message