[mapguide-commits] r9824 - in trunk/MgDev: . Oem/jsoncpp

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Dec 9 03:31:24 PST 2020


Author: jng
Date: 2020-12-09 03:31:23 -0800 (Wed, 09 Dec 2020)
New Revision: 9824

Added:
   trunk/MgDev/Oem/jsoncpp/CMakeLists.txt
Modified:
   trunk/MgDev/cmake_bootstrap.sh
Log:
Add a CMakeLists.txt to jsoncpp so we can build it with CMake instead of relying on scons, which it and/or Python has to be in a particular version range for the build to work. Also speed up common libs subset build by using the (undiscovered until now) --build-one flag in dbxml's buildall.sh to only build xerces and skip everything else

Added: trunk/MgDev/Oem/jsoncpp/CMakeLists.txt
===================================================================
--- trunk/MgDev/Oem/jsoncpp/CMakeLists.txt	                        (rev 0)
+++ trunk/MgDev/Oem/jsoncpp/CMakeLists.txt	2020-12-09 11:31:23 UTC (rev 9824)
@@ -0,0 +1,15 @@
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json
+)
+set(JsonCpp_SRCS
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_reader.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_value.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/json_writer.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json/stdafx.cpp
+)
+add_library(lib_json SHARED ${JsonCpp_SRCS})
+# Pump the library out to ${CMAKE_CURRENT_SOURCE_DIR}/lib so that
+# our existing local jsoncpp detection script still works without modification
+set_target_properties(lib_json PROPERTIES
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
\ No newline at end of file

Modified: trunk/MgDev/cmake_bootstrap.sh
===================================================================
--- trunk/MgDev/cmake_bootstrap.sh	2020-12-05 07:59:31 UTC (rev 9823)
+++ trunk/MgDev/cmake_bootstrap.sh	2020-12-09 11:31:23 UTC (rev 9824)
@@ -290,9 +290,12 @@
     echo "Building JsonCpp (internal)"
     cp -Rf "${SOURCE_DIR}/Oem/jsoncpp" "${OEM_WORK_DIR}/jsoncpp"
     cd "${OEM_WORK_DIR}/jsoncpp" || exit
-    # Use system scons
-    scons platform=linux-gcc
+    mkdir -p build
+    cd build || exit
+    cmake ..
     check_build
+    make
+    check_build
 fi
 if [ "$INTERNAL_GEOS" = "1" ]; then
     echo "Building GEOS (internal)"
@@ -350,31 +353,42 @@
 echo "Has DBXML Library: $HAS_DBXML_LIB"
 echo "Has XQilla Library: $HAS_XQILLA_LIB"
 
-# Even if building the common libs subset, xerces is wedded to the dbxml build script, so we have to build
-# the lot
-#
-# (Re)build DBXML if any of the above is false
-if test $HAS_DBXML_HEADERS -eq 0 -o $HAS_DBCXX_LIB -eq 0 -o $HAS_DBXML_LIB -eq 0 -o $HAS_XQILLA_LIB -eq 0; then
-    echo "Re-building DBXML (${BUILD_CONFIG})"
+if [ "$COMMON_SUBSET_ONLY" == "1" ]; then
     cp -Rf "${SOURCE_DIR}/Oem/dbxml" "${OEM_WORK_DIR}/dbxml"
     cd "${OEM_WORK_DIR}/dbxml" || exit
-    if test $HAVE_SYSTEM_XERCES -eq 1; then
-        echo "Building DBXML with system-installed xerces. Please wait"
-        if test "$BUILD_CONFIG" == Debug; then
-            ./buildall.sh --enable-debug --with-xerces=/usr --have-system-xerces 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
-            check_build
-        else
-            ./buildall.sh --with-xerces=/usr --have-system-xerces 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
-            check_build
-        fi
+    # The buildall.sh script supports a --build-one flag so we can only build xerces and skip everything else
+    echo "Building only xerces. Please wait"
+    if test "$BUILD_CONFIG" == Debug; then
+        ./buildall.sh --enable-debug --build-one=xerces 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
+        check_build
     else
-        echo "Building DBXML with internal copy of xerces. Please wait"
-        if test "$BUILD_CONFIG" == Debug; then
-            ./buildall.sh --enable-debug 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
-            check_build
+        ./buildall.sh --build-one=xerces 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
+        check_build
+    fi
+else
+    # (Re)build DBXML if any of the above is false
+    if test $HAS_DBXML_HEADERS -eq 0 -o $HAS_DBCXX_LIB -eq 0 -o $HAS_DBXML_LIB -eq 0 -o $HAS_XQILLA_LIB -eq 0; then
+        echo "Re-building DBXML (${BUILD_CONFIG})"
+        cp -Rf "${SOURCE_DIR}/Oem/dbxml" "${OEM_WORK_DIR}/dbxml"
+        cd "${OEM_WORK_DIR}/dbxml" || exit
+        if test $HAVE_SYSTEM_XERCES -eq 1; then
+            echo "Building DBXML with system-installed xerces. Please wait"
+            if test "$BUILD_CONFIG" == Debug; then
+                ./buildall.sh --enable-debug --with-xerces=/usr --have-system-xerces 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
+                check_build
+            else
+                ./buildall.sh --with-xerces=/usr --have-system-xerces 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
+                check_build
+            fi
         else
-            ./buildall.sh 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
-            check_build
+            echo "Building DBXML with internal copy of xerces. Please wait"
+            if test "$BUILD_CONFIG" == Debug; then
+                ./buildall.sh --enable-debug 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
+                check_build
+            else
+                ./buildall.sh 2>&1 | tee "$OEM_WORK_DIR/dbxml_build.log"
+                check_build
+            fi
         fi
     fi
 fi



More information about the mapguide-commits mailing list