You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mc...@apache.org on 2012/12/05 20:50:52 UTC
svn commit: r1417610 -
/qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
Author: mcpierce
Date: Wed Dec 5 19:50:51 2012
New Revision: 1417610
URL: http://svn.apache.org/viewvc?rev=1417610&view=rev
Log:
PROTON-178: PHP install paths now honor CMAKE_INSTALL_PREFIX_PREFIX
The EXT and INCLUDE directories are prepended with the install prefix.
The INI directory (PHP_INI_DIR), though, still needs to be overridden
by the developer.
Modified:
qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
Modified: qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt?rev=1417610&r1=1417609&r2=1417610&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt Wed Dec 5 19:50:51 2012
@@ -23,7 +23,6 @@
# Uses the php-config command line tool from PHP to extract the location of the PHP header
# files
-
execute_process(COMMAND ${PHP_CONFIG_EXE} --includes
OUTPUT_VARIABLE PHP_INCLUDES
RESULT_VARIABLE retval
@@ -44,14 +43,18 @@ execute_process(COMMAND ${PHP_CONFIG_EXE
OUTPUT_VARIABLE PHP_EXT_DIR_DEFAULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${PHP_CONFIG_EXE} --prefix
- OUTPUT_VARIABLE PHP_PFX
+ OUTPUT_VARIABLE QPHP_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${PHP_CONFIG_EXE} --config-options
OUTPUT_VARIABLE PHP_OPTS
OUTPUT_STRIP_TRAILING_WHITESPACE)
+# prepend install prefix to the extension directory
+string(REPLACE ${QPHP_PREFIX} ${CMAKE_INSTALL_PREFIX}
+ PHP_PFX_EXT_DIR ${PHP_EXT_DIR_DEFAULT})
+
set(GET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/get_include_dir.php)
-execute_process(COMMAND ${PHP_EXE} -n ${GET_INCLUDE_DIR} ${PHP_PFX}
+execute_process(COMMAND ${PHP_EXE} -n ${GET_INCLUDE_DIR} ${QPHP_PREFIX}
OUTPUT_VARIABLE PHP_INCLUDE_DIR_DEFAULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -59,6 +62,10 @@ if ("${PHP_INCLUDE_DIR_DEFAULT}" STREQUA
set(PHP_INCLUDE_DIR_DEFAULT "/usr/share/php")
endif()
+# prepend install prefix to the include directory
+string(REPLACE ${QPHP_PREFIX} ${CMAKE_INSTALL_PREFIX}
+ PHP_PFX_INCLUDE_DIR ${PHP_INCLUDE_DIR_DEFAULT})
+
string(REGEX MATCH "--with-config-file-scan-dir=([^ ]*)" PHP_OPT_MATCH ${PHP_OPTS})
set (PHP_INI_DIR_DEFAULT ${CMAKE_MATCH_1})
@@ -68,13 +75,13 @@ endif()
if (IS_ABSOLUTE "${PHP_INI_DIR_DEFAULT}" AND (NOT (IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX})))
string(SUBSTRING ${PHP_INI_DIR_DEFAULT} 1 -1 PHP_INI_DIR_DEFAULT)
- string(SUBSTRING ${PHP_EXT_DIR_DEFAULT} 1 -1 PHP_EXT_DIR_DEFAULT)
- string(SUBSTRING ${PHP_INCLUDE_DIR_DEFAULT} 1 -1 PHP_INCLUDE_DIR_DEFAULT)
+ string(SUBSTRING ${PHP_PFX_EXT_DIR} 1 -1 PHP_PFX_EXT_DIR)
+ string(SUBSTRING ${PHP_PFX_INCLUDE_DIR} 1 -1 PHP_PFX_INCLUDE_DIR)
endif ()
-set(PHP_EXT_DIR ${PHP_EXT_DIR_DEFAULT} CACHE PATH "PHP extensions directory.")
+set(PHP_EXT_DIR ${PHP_PFX_EXT_DIR} CACHE PATH "PHP extensions directory.")
set(PHP_INI_DIR ${PHP_INI_DIR_DEFAULT} CACHE PATH "Directory scanned for PHP ini files.")
-set(PHP_INCLUDE_DIR ${PHP_INCLUDE_DIR_DEFAULT} CACHE PATH "PHP include directory.")
+set(PHP_INCLUDE_DIR ${PHP_PFX_INCLUDE_DIR} CACHE PATH "PHP include directory.")
install(TARGETS cproton
DESTINATION ${PHP_EXT_DIR}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org