[mapguide-commits] r9266 - in sandbox/jng/cmake_v2: . Web Web/src Web/src/ApacheAgent Web/src/HttpHandler Web/src/WebApp Web/src/WebSupport cmake/modules

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Dec 25 20:48:58 PST 2017


Author: jng
Date: 2017-12-25 20:48:58 -0800 (Mon, 25 Dec 2017)
New Revision: 9266

Added:
   sandbox/jng/cmake_v2/Web/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/HttpHandler/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/WebApp/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/WebSupport/CMakeLists.txt
   sandbox/jng/cmake_v2/cmake/modules/FindJsonCpp.cmake
Modified:
   sandbox/jng/cmake_v2/CMakeLists.txt
   sandbox/jng/cmake_v2/Web/src/HttpHandler/JsonDoc.h
Log:
CMake-ify some of the Web Tier. Also fix up JsonDoc.h so that it can be used with a system-installed copy of jsoncpp

Modified: sandbox/jng/cmake_v2/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/CMakeLists.txt	2017-12-25 17:07:31 UTC (rev 9265)
+++ sandbox/jng/cmake_v2/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -17,17 +17,22 @@
 include(CheckIncludeFile)
 include(CheckCXXSourceCompiles)
 include(CheckLibraryExists)
+include(ExternalProject)
 
 set(MG_VERSION_MAJOR 3)
 set(MG_VERSION_MINOR 3)
 set(MG_VERSION_RELEASE 0)
 set(MG_VERSION "${MG_VERSION_MAJOR}.${MG_VERSION_MINOR}.${MG_VERSION_RELEASE}")
 
+set(MG_HTTPD_PORT 8008)
+set(MG_TOMCAT_PORT 8009)
+
 set(MG_OEM_CSMAP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Oem/CsMap/Include")
 set(MG_OEM_AGG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Oem/agg-2.4")
 set(MG_OEM_AGG_INCLUDE_DIR "${MG_OEM_AGG_DIR}/include")
 set(MG_OEM_AGG_FREETYPE_DIR "${MG_OEM_AGG_DIR}/font_freetype")
 set(MG_OEM_AGG_SOURCE_DIR "${MG_OEM_AGG_DIR}/src")
+set(MG_OEM_HTTPD_SOURCE_DIR, "${CMAKE_CURRENT_SOURCE_DIR}/Oem/LinuxApt/httpd-2.4.18")
 
 set(MG_OEM_DWF_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Oem/DWFTK/develop/global/src")
 set(MG_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Common")
@@ -58,4 +63,4 @@
 add_subdirectory(Oem)
 add_subdirectory(Common)
 add_subdirectory(Server)
-#add_subdirectory(Web)
+add_subdirectory(Web)

Added: sandbox/jng/cmake_v2/Web/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,8 @@
+add_definitions( -DACE_HAS_THREAD_SAFE_ACCEPT )
+
+# NOTE: Not applied for server tier projects except for mgserver main executable
+if( CMAKE_COMPILER_IS_GNUCXX )
+    set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+endif( CMAKE_COMPILER_IS_GNUCXX )
+
+add_subdirectory(src)
\ No newline at end of file

Added: sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,40 @@
+include_directories(
+    ${MG_COMMON_DIR}/Foundation
+    ${MG_COMMON_DIR}/Geometry
+    ${MG_COMMON_DIR}/PlatformBase
+    ${MG_COMMON_DIR}/MapGuideCommon
+    ${MG_COMMON_DIR}/MdfModel
+    ${ACE_INCLUDE_DIR}
+    ${MG_OEM_HTTPD_SOURCE_DIR}/include
+    ${MG_OEM_HTTPD_SOURCE_DIR}/srclib/apr/include
+    ${MG_OEM_HTTPD_SOURCE_DIR}/srclib/apr-util/include
+    ${MG_OEM_HTTPD_SOURCE_DIR}/os/unix
+    ${CMAKE_CURRENT_SOURCE_DIR}/../HttpHandler
+    ${CMAKE_CURRENT_SOURCE_DIR}/../WebSupport
+    ${CMAKE_CURRENT_SOURCE_DIR}/../MapAgentCommon
+)
+
+set(mod_mgmapagent_SRCS
+    ApacheAgent.cpp
+    ApachePostParser.cpp
+    ApacheReaderStreamer.cpp
+    ApacheResponseHandler.cpp
+    ../MapAgentCommon/MapAgentCommon.cpp
+    ../MapAgentCommon/MapAgentGetParser.cpp
+    ../MapAgentCommon/MapAgentStrings.cpp
+    ../WebSupport/InitializeWebTier.cpp
+)
+
+add_library(mod_mgmapagent SHARED ${mod_mgmapagent_SRCS})
+
+target_link_libraries(mod_mgmapagent
+    MgFoundation-${MG_VERSION}
+    MgPlatformBase-${MG_VERSION}
+    MgMdfModel-${MG_VERSION}
+    MgMdfParser-${MG_VERSION}
+    MgHttpHandler-${MG_VERSION}
+    MgWebSupport-${MG_VERSION}
+)
+
+# Make sure this doesn't have the "lib" prefix
+set_target_properties(mod_mgmapagent PROPERTIES PREFIX "")
\ No newline at end of file

Added: sandbox/jng/cmake_v2/Web/src/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/src/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,8 @@
+add_subdirectory(WebApp)
+add_subdirectory(WebSupport)
+add_subdirectory(HttpHandler)
+#add_subdirectory(CgiAgent)
+#add_subdirectory(PhpApi)
+#add_subdirectory(JavaApi)
+#add_subdirectory(JavaApiEx)
+#add_subdirectory(ApacheAgent)
\ No newline at end of file

Added: sandbox/jng/cmake_v2/Web/src/HttpHandler/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/HttpHandler/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/src/HttpHandler/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,27 @@
+find_package (JsonCpp REQUIRED)
+
+include_directories(${JsonCpp_INCLUDE_DIR}
+    ${MG_COMMON_DIR}/MdfModel
+    ${MG_COMMON_DIR}/Foundation
+    ${MG_COMMON_DIR}/Geometry
+    ${MG_COMMON_DIR}/PlatformBase
+    ${MG_COMMON_DIR}/MapGuideCommon
+    ${ACE_INCLUDE_DIR}
+    ${XERCESC_INCLUDE_DIR}
+)
+
+set(MgHttpHandler_SRCS
+    HttpHandlerBuild.cpp
+)
+
+add_library(MgHttpHandler-${MG_VERSION} SHARED ${MgHttpHandler_SRCS})
+
+target_link_libraries(MgHttpHandler-${MG_VERSION}
+    MgFoundation-${MG_VERSION}
+    MgGeometry-${MG_VERSION}
+    MgPlatformBase-${MG_VERSION}
+    MgMapGuideCommon-${MG_VERSION}
+    ${JsonCpp_LIBRARY}
+    MgMdfModel-${MG_VERSION}
+    MgMdfParser-${MG_VERSION}
+)
\ No newline at end of file

Modified: sandbox/jng/cmake_v2/Web/src/HttpHandler/JsonDoc.h
===================================================================
--- sandbox/jng/cmake_v2/Web/src/HttpHandler/JsonDoc.h	2017-12-25 17:07:31 UTC (rev 9265)
+++ sandbox/jng/cmake_v2/Web/src/HttpHandler/JsonDoc.h	2017-12-26 04:48:58 UTC (rev 9266)
@@ -23,25 +23,29 @@
 
 struct MgJsonNode
 {
-    MgJsonNode() {}
+    MgJsonNode() : Name(StaticString(NULL)) {}
     MgJsonNode(const StaticString &name, Json::Value element)
+        : Name(name)
     {
         this->Name = name;
         this->Element = element;
         this->isUsingStaticString = true;
     }
     MgJsonNode(const string &name, Json::Value element)
+        : Name(StaticString(NULL))
     {
         this->strName = name;
         this->Element = element;
         this->isUsingStaticString = false;
     }
     MgJsonNode(Json::Value element, int index)
+        : Name(StaticString(NULL))
     {
         this->Element = element;
         this->Index = index;
     }
     MgJsonNode(Json::Value element)
+        : Name(StaticString(NULL))
     {
         this->Element = element;
     }

Added: sandbox/jng/cmake_v2/Web/src/WebApp/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/WebApp/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/src/WebApp/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,49 @@
+include_directories(${MG_COMMON_DIR}/MdfModel
+    ${MG_COMMON_DIR}/Foundation
+    ${MG_COMMON_DIR}/Geometry
+    ${MG_COMMON_DIR}/PlatformBase
+    ${MG_COMMON_DIR}/MapGuideCommon
+    ${XERCESC_INCLUDE_DIR}
+    ${ACE_INCLUDE_DIR}
+)
+
+set(MgWebApp_SRCS
+    WebBufferCommand.cpp
+    WebCommand.cpp
+    WebCommandCollection.cpp
+    WebCommandWidget.cpp
+    WebContextMenu.cpp
+    WebFlyoutWidget.cpp
+    WebGettingStarted.cpp
+    WebGetPrintablePageCommand.cpp
+    WebHelpCommand.cpp
+    WebInformationPane.cpp
+    WebInvokeScriptCommand.cpp
+    WebInvokeUrlCommand.cpp
+    WebLayout.cpp
+    WebMeasureCommand.cpp
+    WebPrintCommand.cpp
+    WebSearchCommand.cpp
+    WebSelectWithinCommand.cpp
+    WebSeparatorWidget.cpp
+    WebTaskBarWidget.cpp
+    WebTaskBar.cpp
+    WebTaskPane.cpp
+    WebToolbar.cpp
+    WebUiPane.cpp
+    WebUiSizablePane.cpp
+    WebUiTargetCommand.cpp
+    WebViewOptionsCommand.cpp
+    WebWidget.cpp
+    WebWidgetCollection.cpp
+)
+
+add_library(MgWebApp-${MG_VERSION} SHARED ${MgWebApp_SRCS})
+
+target_link_libraries(MgWebApp-${MG_VERSION}
+    ${XERCESC_LIBRARIES}
+    MgFoundation-${MG_VERSION}
+    MgGeometry-${MG_VERSION}
+    MgPlatformBase-${MG_VERSION}
+    MgMapGuideCommon-${MG_VERSION}
+)
\ No newline at end of file

Added: sandbox/jng/cmake_v2/Web/src/WebSupport/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/WebSupport/CMakeLists.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/Web/src/WebSupport/CMakeLists.txt	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,19 @@
+include_directories(${MG_COMMON_DIR}/MdfModel
+    ${MG_COMMON_DIR}/Foundation
+    ${MG_COMMON_DIR}/Geometry
+    ${MG_COMMON_DIR}/PlatformBase
+    ${MG_COMMON_DIR}/MapGuideCommon
+    ${ACE_INCLUDE_DIR}
+)
+
+set(MgWebSupport_SRCS
+    InitializeWebTier.cpp
+)
+
+add_library(MgWebSupport-${MG_VERSION} SHARED ${MgWebSupport_SRCS})
+
+target_link_libraries(MgWebSupport-${MG_VERSION}
+    MgFoundation-${MG_VERSION}
+    MgPlatformBase-${MG_VERSION}
+    MgMapGuideCommon-${MG_VERSION}
+)
\ No newline at end of file

Added: sandbox/jng/cmake_v2/cmake/modules/FindJsonCpp.cmake
===================================================================
--- sandbox/jng/cmake_v2/cmake/modules/FindJsonCpp.cmake	                        (rev 0)
+++ sandbox/jng/cmake_v2/cmake/modules/FindJsonCpp.cmake	2017-12-26 04:48:58 UTC (rev 9266)
@@ -0,0 +1,25 @@
+# - Find JsonCpp
+# Find the JsonCpp includes and client library
+# This module defines
+#  JsonCpp_INCLUDE_DIR, where to find JsonCpp.h
+#  JsonCpp_LIBRARY, the libraries needed to use JsonCpp.
+#  JsonCpp_FOUND, If false, do not try to use JsonCpp.
+
+find_path(JsonCpp_INCLUDE_DIR 
+    NAMES "json/json.h"
+    HINTS "/usr/include"
+          "/usr/include/jsoncpp")
+find_library(JsonCpp_LIBRARY NAMES jsoncpp)
+
+include(FindPackageHandleStandardArgs)
+
+# handle the QUIETLY and REQUIRED arguments and set CPPUNIT_FOUND to TRUE if 
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JsonCpp DEFAULT_MSG JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR)
+
+if (JsonCpp_FOUND)
+   message(STATUS "Found libJsonCpp: ${JsonCpp_INCLUDE_DIR}, ${JsonCpp_LIBRARY}")
+endif (JsonCpp_FOUND)
+
+mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
+



More information about the mapguide-commits mailing list