[mapguide-commits] r10264 - in branches/4.0/MgDev: . Bindings Bindings/src/Bindings/DotNet/Portable Common Common/Stylization Portable/MgPortable Server/src/Gws

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Nov 4 02:34:14 PST 2026


Author: jng
Date: 2026-11-04 02:34:11 -0800 (Wed, 04 Nov 2026)
New Revision: 10264

Modified:
   branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd
   branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt
   branches/4.0/MgDev/CMakeLists.txt
   branches/4.0/MgDev/Common/CMakeLists.txt
   branches/4.0/MgDev/Common/Stylization/CMakeLists.txt
   branches/4.0/MgDev/Portable/MgPortable/CMakeLists.txt
   branches/4.0/MgDev/Server/src/Gws/CMakeLists.txt
Log:
#2897: More CMake target tweaks to support MapGuide Portable

Modified: branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd
===================================================================
--- branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd	2026-11-04 10:34:11 UTC (rev 10264)
@@ -43,6 +43,30 @@
 copy /Y /L "%~p0\linux-x64\lib64\libMgGwsCommon-%SOVER%.so" "%PORTABLE_NATIVE%"
 copy /Y /L "%~p0\linux-x64\lib64\libMgGwsQueryEngine-%SOVER%.so" "%PORTABLE_NATIVE%"
 copy /Y /L "%~p0\linux-x64\lib64\libMgGwsResource-%SOVER%.so" "%PORTABLE_NATIVE%"
+rem FDO. The tarball keeps the whole FDO install in a top-level fdo subtree; MgPortable links
+rem libFDO and libExpressionEngine, and the connection manager loads a provider from the
+rem directory of the providers.xml it read, so the FDO libraries, the providers and
+rem providers.xml are all flattened into the same native directory here. Only the versioned
+rem library files are copied: the runtime needs the SONAMEs the providers link against, not the
+rem -lFDO style symlinks.
+set FDO_LINUX=%~p0\linux-x64\fdo\lib64
+copy /Y /L "%FDO_LINUX%\libFDO-*.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%FDO_LINUX%\libExpressionEngine-*.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%FDO_LINUX%\lib*Provider-*.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%FDO_LINUX%\lib*Overrides-*.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%FDO_LINUX%\libOWS-*.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%FDO_LINUX%\providers.xml" "%PORTABLE_NATIVE%"
+rem The generic FDO SDK bundles the gdal/xerces/xalan it was built against; a distro build links
+rem the system copies and has none of these, so their absence is not an error.
+if exist "%FDO_LINUX%\libgdal.so.*.*" copy /Y /L "%FDO_LINUX%\libgdal.so.*.*" "%PORTABLE_NATIVE%"
+if exist "%FDO_LINUX%\libxerces-c-*.so" copy /Y /L "%FDO_LINUX%\libxerces-c-*.so" "%PORTABLE_NATIVE%"
+if exist "%FDO_LINUX%\libxalan-c.so.*.*" copy /Y /L "%FDO_LINUX%\libxalan-c.so.*.*" "%PORTABLE_NATIVE%"
+if exist "%FDO_LINUX%\libxalanMsg.so.*.*" copy /Y /L "%FDO_LINUX%\libxalanMsg.so.*.*" "%PORTABLE_NATIVE%"
+rem com/ holds the RDBMS MetaSchema creation scripts and the coordinate system catalogue, which
+rem the providers find as the "com" sub-directory of the directory they were loaded from.
+if exist "%FDO_LINUX%\com" xcopy /E /I /Y "%FDO_LINUX%\com" "%PORTABLE_NATIVE%\com" >nul
+rem nls/ holds the message catalogues; a consumer points NLSPATH at it to get localised text.
+if exist "%~p0\linux-x64\fdo\nls" xcopy /E /I /Y "%~p0\linux-x64\fdo\nls" "%PORTABLE_NATIVE%\nls" >nul
 goto :Done
 :NoPortableTarball
 echo No MgPortable linux native libs tarball specified or tarball does not exist.

Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/CMakeLists.txt	2026-11-04 10:34:11 UTC (rev 10264)
@@ -28,7 +28,7 @@
     # NOTE: We don't care where this source is generated because the C# source is only built on windows
     set(MG_DOTNET_PROJECT_DIR ${CMAKE_CURRENT_BINARY_DIR})
     set_target_properties(PortableUnmanagedApi PROPERTIES
-        INSTALL_RPATH "$ORIGIN:$ORIGIN/../../lib64")
+        INSTALL_RPATH "${MG_PORTABLE_INSTALL_RPATH}")
 endif (UNIX)
 if (MSVC)
     add_definitions(-DSWIG_PUBLIC_API)

Modified: branches/4.0/MgDev/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/CMakeLists.txt	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/CMakeLists.txt	2026-11-04 10:34:11 UTC (rev 10264)
@@ -104,6 +104,12 @@
 
 option(WITH_PORTABLE "Build MgPortable (the portable MapGuide API)" OFF)
 
+# Runtime search path for the libraries MgPortable and its dependants install. Two layouts have to
+# work: the install tree, where MgPortable's libraries sit in <prefix>/portable/lib64 and the common
+# ones in <prefix>/lib64, and the MgPortable tarball, which flattens the portable libraries into
+# lib64/ and keeps the whole FDO install in a sibling fdo/lib64 so it travels as one subtree.
+set(MG_PORTABLE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../../lib64:$ORIGIN/../fdo/lib64")
+
 set(MG_AUTO_GENERATED_HEADER_DIR "${CMAKE_CURRENT_BINARY_DIR}/IncludeAutogenerated")
 set(MG_UNIT_TEST_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/UnitTest/TestData")
 

Modified: branches/4.0/MgDev/Common/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Common/CMakeLists.txt	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/Common/CMakeLists.txt	2026-11-04 10:34:11 UTC (rev 10264)
@@ -32,6 +32,12 @@
     add_subdirectory(Renderers)
     add_subdirectory(Stylization)
     set_install_subdir("")
+    # MgStylization links FDO (as a PRIVATE dependency, so it is not inherited by MgRenderers),
+    # so it is the only one of the pair that needs the FDO runtime search path.
+    if (UNIX)
+        set_target_properties(MgStylization${MG_VERSION_SUFFIX} PROPERTIES
+            INSTALL_RPATH "${MG_PORTABLE_INSTALL_RPATH}")
+    endif (UNIX)
 endif (NOT MG_COMMON_SUBSET_ONLY)
 
 if (NOT MG_COMMON_SUBSET_ONLY)

Modified: branches/4.0/MgDev/Common/Stylization/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Common/Stylization/CMakeLists.txt	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/Common/Stylization/CMakeLists.txt	2026-11-04 10:34:11 UTC (rev 10264)
@@ -100,11 +100,18 @@
 
 add_library(MgStylization${MG_VERSION_SUFFIX} SHARED ${MgStylization_SRCS})
 
+# FDO is an implementation detail of the styling code: nothing that links this library needs to
+# call an FDO symbol through it, and a consumer that does name FDO on its own link line (the server
+# core, MgPortable, the unit-test runner) already lists it. Declaring it PRIVATE keeps it off the
+# consumers' link lines, which on Linux otherwise record a DT_NEEDED for libraries that use no FDO
+# symbol at all - MgRenderers being the one that matters, since its Windows project imports none.
 target_link_libraries(MgStylization${MG_VERSION_SUFFIX}
-    ${FDO_EXPRESSIONENGINE_LIBRARY}
-    ${FDO_LIBRARY}
-    MgFoundation${MG_VERSION_SUFFIX}
-    MgMdfModel${MG_VERSION_SUFFIX}
+    PRIVATE
+        ${FDO_EXPRESSIONENGINE_LIBRARY}
+        ${FDO_LIBRARY}
+    PUBLIC
+        MgFoundation${MG_VERSION_SUFFIX}
+        MgMdfModel${MG_VERSION_SUFFIX}
 )
 
 install( TARGETS MgStylization${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT} )

Modified: branches/4.0/MgDev/Portable/MgPortable/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Portable/MgPortable/CMakeLists.txt	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/Portable/MgPortable/CMakeLists.txt	2026-11-04 10:34:11 UTC (rev 10264)
@@ -31,9 +31,10 @@
 
 add_library(MgPortable${MG_VERSION_SUFFIX} SHARED ${MgPortable_SRCS})
 # The library installs beside the GWS libraries under <prefix>/portable/lib64, while the
-# common libraries it links stay in <prefix>/lib64.
+# common libraries it links stay in <prefix>/lib64 and FDO lives in a sibling fdo/lib64 in the
+# MgPortable tarball.
 set_target_properties(MgPortable${MG_VERSION_SUFFIX} PROPERTIES
-    INSTALL_RPATH "$ORIGIN:$ORIGIN/../../lib64")
+    INSTALL_RPATH "${MG_PORTABLE_INSTALL_RPATH}")
 install(TARGETS MgPortable${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
 install_symlink(libMgPortable${MG_VERSION_SUFFIX}.so libMgPortable.so ${MG_COMPONENT})
 

Modified: branches/4.0/MgDev/Server/src/Gws/CMakeLists.txt
===================================================================
--- branches/4.0/MgDev/Server/src/Gws/CMakeLists.txt	2026-11-03 14:32:34 UTC (rev 10263)
+++ branches/4.0/MgDev/Server/src/Gws/CMakeLists.txt	2026-11-04 10:34:11 UTC (rev 10264)
@@ -12,4 +12,14 @@
 
 add_subdirectory(GwsCommon)
 add_subdirectory(GwsQueryEngine)
-add_subdirectory(GwsResource)
\ No newline at end of file
+add_subdirectory(GwsResource)
+
+# MgGwsCommon and MgGwsQueryEngine use FDO, so in a portable build they have to be able to find it
+# in the same two places MgPortable does (see MG_PORTABLE_INSTALL_RPATH). MgGwsResource has no
+# dependencies of its own, so it gets nothing.
+if (MG_COMMON_SUBSET_ONLY AND WITH_PORTABLE AND UNIX)
+    foreach (gws_target MgGwsCommon MgGwsQueryEngine)
+        set_target_properties(${gws_target}${MG_VERSION_SUFFIX} PROPERTIES
+            INSTALL_RPATH "${MG_PORTABLE_INSTALL_RPATH}")
+    endforeach (gws_target)
+endif (MG_COMMON_SUBSET_ONLY AND WITH_PORTABLE AND UNIX)
\ No newline at end of file



More information about the mapguide-commits mailing list