summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-28 15:37:37 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-28 15:37:37 (GMT)
commitf1f3aa838e22facbee58dd54debdf62da524e7b7 (patch)
tree7b3990d74749fb9e3a4fe0989cd9a6841fe6735c
parent772ef4645c6137ff66973d5b9a6a9d74cfb24105 (diff)
downloadlibkolabxml-f1f3aa838e22facbee58dd54debdf62da524e7b7.tar.gz
Only attempt to do anything with PHP if PHP can actually be found (#658)
-rw-r--r--src/php/CMakeLists.txt44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/php/CMakeLists.txt b/src/php/CMakeLists.txt
index 7cfc5c7..31ea9c6 100644
--- a/src/php/CMakeLists.txt
+++ b/src/php/CMakeLists.txt
@@ -19,23 +19,27 @@ if (APPLE)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )
endif()
-find_package(PHP4)
-include_directories(${PHP4_INCLUDE_PATH})
-add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
-target_link_libraries(phpbindings kolabxml ${PHP_LIBRARIES})
-SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
-SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
-
-configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
-
-if (KOLAB_PHP_INSTALL_DIR)
- set(PHP_INSTALL_DIR ${KOLAB_PHP_INSTALL_DIR})
-else (KOLAB_PHP_INSTALL_DIR)
- set(PHP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
-endif (KOLAB_PHP_INSTALL_DIR)
-
-install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
-
-install( FILES
- ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
- DESTINATION ${PHP_INSTALL_DIR}) \ No newline at end of file
+find_package(PHP)
+
+if (PHP_FOUND)
+ include_directories(${PHP_INCLUDE_PATH})
+ add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
+ target_link_libraries(phpbindings kolabxml ${PHP_LIBRARIES})
+ SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
+ SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
+
+ configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+
+ if (KOLAB_PHP_INSTALL_DIR)
+ set(PHP_INSTALL_DIR ${KOLAB_PHP_INSTALL_DIR})
+ else (KOLAB_PHP_INSTALL_DIR)
+ set(PHP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
+ endif (KOLAB_PHP_INSTALL_DIR)
+
+ install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
+
+ install( FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
+ DESTINATION ${PHP_INSTALL_DIR}
+ )
+endif (PHP_FOUND)