2 # This module finds if PHP4 is installed and determines where the include files
3 # and libraries are. It also determines what the name of the library is. This
4 # code sets the following variables:
6 # PHP4_INCLUDE_PATH = path to where php.h can be found
7 # PHP4_EXECUTABLE = full path to the php4 binary
10 #=============================================================================
11 # Copyright 2004-2009 Kitware, Inc.
13 # Distributed under the OSI-approved BSD License (the "License");
14 # see accompanying file Copyright.txt for details.
16 # This software is distributed WITHOUT ANY WARRANTY; without even the
17 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 # See the License for more information.
19 #=============================================================================
20 # (To distribute this file outside of CMake, substitute the full
21 # License text for the above reference.)
23 set(PHP4_POSSIBLE_INCLUDE_PATHS
25 /usr/local/include/php4
27 /usr/local/include/php
31 set(PHP4_POSSIBLE_LIB_PATHS
35 find_path(PHP4_FOUND_INCLUDE_PATH main/php.h
36 ${PHP4_POSSIBLE_INCLUDE_PATHS})
38 if(PHP4_FOUND_INCLUDE_PATH)
39 set(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
40 foreach(php4_path Zend main TSRM)
41 set(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
43 set(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
46 find_program(PHP4_EXECUTABLE NAMES php4 php )
50 PHP4_FOUND_INCLUDE_PATH
54 # this is a hack for now
55 set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
56 "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
62 __zend_get_parameters_array_ex
72 _zend_register_internal_class_ex
73 _zend_register_list_destructors_ex
74 _zend_register_resource
75 _zend_rsrc_list_get_rsrc_type
76 _zend_wrong_param_count
79 set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
80 "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
84 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
85 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH)