summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-07 14:35:19 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-07 14:35:19 (GMT)
commitc0ffa7a021db64c8f1a4a6ead4e58f6b5a6b783d (patch)
tree0b68a564c40c8a9828a3e2f775ff8480b0a0051d
parent9cfecd2b67ed3f07ba898c824b8628cedde21bb7 (diff)
downloadlibkolabxml-c0ffa7a021db64c8f1a4a6ead4e58f6b5a6b783d.tar.gz
Untwist the Debian Wheezy twists wrt. PHP headers in /usr/include/php5 referring to themselves in the wrong way, and the standard installation paths for a variety of headers having been modified from the defacto standard locations.
-rw-r--r--src/php/CMakeLists.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/php/CMakeLists.txt b/src/php/CMakeLists.txt
index aec9cd6..20647a5 100644
--- a/src/php/CMakeLists.txt
+++ b/src/php/CMakeLists.txt
@@ -20,10 +20,19 @@ if (APPLE)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )
endif()
-find_package(PHP4 5.3 REQUIRED)
+# Debian (Wheezy) won't be able to find PHP using find_package. In packaging libkolabxml
+# for it, we define the include path and executable during the build.
+if (NOT PHP4_INCLUDE_PATH OR NOT PHP4_EXECUTABLE)
+ find_package(PHP4 5.3 REQUIRED)
+endif (NOT PHP4_INCLUDE_PATH OR NOT PHP4_EXECUTABLE)
-if (PHP4_FOUND)
+if (PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
include_directories(${PHP4_INCLUDE_PATH})
+
+ # In an additional twist on Debian (Wheezy) - the PHP headers are fubar. php.h is in main/,
+ # TSRM/TSRM.h includes <tsrm_config.h> instead of "tsrm_config.h", and we require
+ # Zend/zend.h (included, of course, as "zend.h" without -I/usr/include/php5/Zend)
+ include_directories("${PHP4_INCLUDE_PATH}/Zend" "${PHP4_INCLUDE_PATH}/TSRM" "${PHP4_INCLUDE_PATH}/main")
add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
target_link_libraries(phpbindings kolabxml)
SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
@@ -39,6 +48,6 @@ if (PHP4_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
DESTINATION ${PHP_INSTALL_DIR}
)
-else(PHP4_FOUND)
+else(PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
message(WARNING "not building php bindings because php was not found")
-endif (PHP4_FOUND)
+endif (PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))