diff options
author | Sandro Knauß <hefee@debian.org> | 2017-12-03 11:23:50 +0100 |
---|---|---|
committer | Sandro Knauß <hefee@debian.org> | 2017-12-03 11:23:50 +0100 |
commit | 7b1e8a415ab8615bd26080f3362de2730d269421 (patch) | |
tree | 7643db93f8c3890969ff83412389e73caf4609ca | |
parent | 496b0a973bd429eb1f9eb1472ef24a0ffb1dbd12 (diff) |
find php includepath
Origin: Debian
Last-Update: 2016-04-29
phpincludepath under debian has switched
from /usr/include/php/ to /usr/include/php/$(PHPAPI)
so we use php-config to get the correct install path.
Last-Update: 2016-04-29
Gbp-Pq: Name use-phpconfig-to-detect-phpincludedir.patch
-rw-r--r-- | src/php/CMakeLists.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/php/CMakeLists.txt b/src/php/CMakeLists.txt index a42779c..196f6b4 100644 --- a/src/php/CMakeLists.txt +++ b/src/php/CMakeLists.txt @@ -26,13 +26,23 @@ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-unused-label # Try to find PHP5 find_path(PHP_INCLUDE_DIR NAMES main/php.h PATH_SUFFIXES php php5) find_program(PHP_EXECUTABLE NAMES php) +find_program(PHP_CONFIG_EXECUTABLE NAMES php-config) # Libkolabxml needs PHP >= 5.3 set(PHP_MIN_VERSION 50300) +if(NOT PHP_INCLUDE_DIR) + if(PHP_CONFIG_EXECUTABLE) + execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --include-dir + OUTPUT_VARIABLE _php_include_dir + ) + string(REGEX REPLACE "\n" "" _php_include_dir "${_php_include_dir}") + set(PHP_INCLUDE_DIR ${_php_include_dir}) + endif() +endif() + # Find where to install the extension files if it's not defined if(NOT DEFINED PHP_INSTALL_DIR) - find_program(PHP_CONFIG_EXECUTABLE NAMES php-config) if(PHP_CONFIG_EXECUTABLE) execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --extension-dir OUTPUT_VARIABLE _php_extensions_dir |