[mapguide-commits] r9283 - in sandbox/jng/cmake_v2: Oem Web/src Web/src/PhpApi

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 5 10:33:30 PST 2018


Author: jng
Date: 2018-01-05 10:33:30 -0800 (Fri, 05 Jan 2018)
New Revision: 9283

Added:
   sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt
Modified:
   sandbox/jng/cmake_v2/Oem/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/CMakeLists.txt
Log:
Add CMake configuration for PhpApi

Modified: sandbox/jng/cmake_v2/Oem/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Oem/CMakeLists.txt	2018-01-05 16:23:18 UTC (rev 9282)
+++ sandbox/jng/cmake_v2/Oem/CMakeLists.txt	2018-01-05 18:33:30 UTC (rev 9283)
@@ -108,6 +108,11 @@
 )
 add_dependencies(php httpd-fake)
 
+# This sounds dirty, but we need to communicate back to projects that use php (in a different dir) where 
+# the httpd headers are
+set(MG_OEM_PHP_SOURCE_DIR "${LinuxAptPhp_WORKDIR}" PARENT_SCOPE)
+set(MG_OEM_PHP_LIB_DIR "${LinuxAptPhp_WORKDIR}/libs" PARENT_SCOPE)
+
 ###### Everything else ######
 
 # TODO: We have geos in-tree, which is CMake-enabled, so if required we can use

Modified: sandbox/jng/cmake_v2/Web/src/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/CMakeLists.txt	2018-01-05 16:23:18 UTC (rev 9282)
+++ sandbox/jng/cmake_v2/Web/src/CMakeLists.txt	2018-01-05 18:33:30 UTC (rev 9283)
@@ -3,7 +3,7 @@
 add_subdirectory(WebSupport)
 add_subdirectory(HttpHandler)
 #add_subdirectory(CgiAgent)
-#add_subdirectory(PhpApi)
+add_subdirectory(PhpApi)
 if (WITH_JAVA)
     add_subdirectory(JavaApi)
     add_subdirectory(JavaApiEx)

Added: sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt	2018-01-05 18:33:30 UTC (rev 9283)
@@ -0,0 +1,74 @@
+if (CMAKE_COMPILER_IS_GNUCXX)
+    message ("Restoring default linker flags for libphp_MapGuideApi")
+    set ( CMAKE_SHARED_LINKER_FLAGS "${WEB_CMAKE_SHARED_LINKER_FLAGS}")
+endif (CMAKE_COMPILER_IS_GNUCXX)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}
+    ${MG_COMMON_DIR}/MdfModel
+    ${MG_COMMON_DIR}/Foundation
+    ${MG_COMMON_DIR}/Geometry
+    ${MG_COMMON_DIR}/PlatformBase
+    ${MG_COMMON_DIR}/MapGuideCommon
+    ${MG_OEM_PHP_SOURCE_DIR}/TSRM
+    ${MG_OEM_PHP_SOURCE_DIR}/Zend
+    ${MG_OEM_PHP_SOURCE_DIR}/main
+    ${MG_OEM_PHP_SOURCE_DIR}
+    ${ACE_INCLUDE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}/../HttpHandler
+    ${CMAKE_CURRENT_SOURCE_DIR}/../WebSupport
+    ${CMAKE_CURRENT_SOURCE_DIR}/../WebApp
+    ${XERCESC_INCLUDE_DIR}
+)
+
+add_definitions(-DPHP -DPHPPROXYAPI_EXPORTS)
+add_definitions(-fno-var-tracking-assignments)
+
+set(php_MapGuideApi_SRCS
+    ${CMAKE_CURRENT_BINARY_DIR}/MgApi_wrap.cpp
+)
+
+add_custom_command(OUTPUT ${php_MapGuideApi_SRCS}
+    COMMAND ${IMAKE_TOOL} -p ../MapGuideApi/MapGuideApiGen.xml
+            -l PHP
+            -r ${CMAKE_CURRENT_SOURCE_DIR}
+            -o ${CMAKE_CURRENT_BINARY_DIR}
+            -i ${CMAKE_CURRENT_BINARY_DIR}
+    COMMAND ${CMAKE_COMMAND} -E copy
+            ${CMAKE_CURRENT_BINARY_DIR}/php.i
+            ${CMAKE_CURRENT_BINARY_DIR}/language.i
+    COMMAND ${IMAKE_TOOL} -p ${CMAKE_CURRENT_BINARY_DIR}/../MapGuideApi/Constants.xml 
+            -l PHP 
+            -r ${CMAKE_CURRENT_SOURCE_DIR}
+            -o ${CMAKE_CURRENT_BINARY_DIR}/constants.php
+            -t
+    COMMAND ${SWIG_TOOL} -c++ -php -DPHPSWIG
+            -baseexception MgException -clsidcode getclassid.code -clsiddata m_cls_id 
+            -catchallcode catchall.code 
+            -dispose \"((MgDisposable*)arg1)->Release()\" 
+            -rethrow \"e->Raise()\;\" 
+            -nodefault
+            -o ${php_MapGuideApi_SRCS} 
+            -lib ${SWIG_LIB_PATH} 
+            ${CMAKE_CURRENT_BINARY_DIR}/MapGuideApi.i
+)
+
+add_library(php_MapGuideApi${MG_VERSION_SUFFIX} SHARED ${php_MapGuideApi_SRCS})
+install(TARGETS php_MapGuideApi${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
+install_symlink(${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libphp_MapGuideApi${MG_VERSION_SUFFIX}.so libphp_MapGuideApi.so ${MG_COMPONENT})
+
+target_link_libraries(php_MapGuideApi${MG_VERSION_SUFFIX}
+    ${ACE_LIBRARY}
+    MgFoundation${MG_VERSION_SUFFIX}
+    MgGeometry${MG_VERSION_SUFFIX}
+    MgPlatformBase${MG_VERSION_SUFFIX}
+    MgMapGuideCommon${MG_VERSION_SUFFIX}
+    MgHttpHandler${MG_VERSION_SUFFIX}
+    MgMdfModel${MG_VERSION_SUFFIX}
+    MgMdfParser${MG_VERSION_SUFFIX}
+    ${XERCESC_LIBRARIES}
+    MgWebApp${MG_VERSION_SUFFIX}
+)
+
+file(COPY "php.i" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY "getclassid.code" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY "catchall.code" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
\ No newline at end of file



More information about the mapguide-commits mailing list