[mapguide-commits] r9305 - in sandbox/jng/cmake_v2: . Server/src/Core Server/src/UnitTesting

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Jan 10 01:28:03 PST 2018


Author: jng
Date: 2018-01-10 01:28:03 -0800 (Wed, 10 Jan 2018)
New Revision: 9305

Modified:
   sandbox/jng/cmake_v2/CMakeLists.txt
   sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt
   sandbox/jng/cmake_v2/Server/src/UnitTesting/CMakeLists.txt
Log:
Tweak setup so mgserver can easily be run where it is built, improving the testing/debugging inner loop

Modified: sandbox/jng/cmake_v2/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/CMakeLists.txt	2018-01-10 07:33:00 UTC (rev 9304)
+++ sandbox/jng/cmake_v2/CMakeLists.txt	2018-01-10 09:28:03 UTC (rev 9305)
@@ -68,6 +68,7 @@
 set(MG_SERVER_GWS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Server/src/Gws")
 
 set(MG_AUTO_GENERATED_HEADER_DIR "${CMAKE_CURRENT_BINARY_DIR}/IncludeAutogenerated")
+set(MG_UNIT_TEST_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/UnitTest/TestData")
 
 set(MG_COMPONENT_COMMON "common")
 set(MG_COMPONENT_SERVER "server")

Modified: sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt	2018-01-10 07:33:00 UTC (rev 9304)
+++ sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt	2018-01-10 09:28:03 UTC (rev 9305)
@@ -1,3 +1,7 @@
+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 )
+
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}
     ${ACE_INCLUDE_DIR}
     ${XERCESC_INCLUDE_DIR}
@@ -75,14 +79,31 @@
     MgStylization${MG_VERSION_SUFFIX}
     MgRenderers${MG_VERSION_SUFFIX}
 )
+
+########### BEGIN Development/Testing environment setup #############
+file(GLOB_RECURSE UNIT_TEST_FILES "${MG_UNIT_TEST_DATA_DIR}/*.*")
+file(COPY ${UNIT_TEST_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../UnitTestFiles)
+
+# Symlink the built copy to facilitate inner loop testing/debugging
+# The actual symlink installation is done in the UnitTesting CMakeLists.txt
+execute_process(COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/../UnitTesting/libMgUnitTesting.so ${CMAKE_CURRENT_BINARY_DIR}/libMgUnitTesting.so)
+set(ORIG_MG_INSTALL_SERVER_PREFIX "${MG_INSTALL_SERVER_PREFIX}")
+set(MG_INSTALL_SERVER_PREFIX "${CMAKE_CURRENT_BINARY_DIR}")
+configure_file(${CMAKE_MODULE_PATH}/../configs/serverconfig.ini.in ${CMAKE_CURRENT_BINARY_DIR}/serverconfig.ini)
+set(MG_INSTALL_SERVER_PREFIX "${ORIG_MG_INSTALL_SERVER_PREFIX}")
+file(COPY ${MG_COMMON_DIR}/MapGuideCommon/Resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY ${MG_COMMON_DIR}/Schema DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
+########### END Development/Testing environment setup #############
+
 install(TARGETS mgserver DESTINATION ${MG_SERVER_BIN_DIR} COMPONENT ${MG_COMPONENT})
 if (UNIX)
     file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/mapguidectl DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
     execute_process(COMMAND sed -i "s#/usr/local/mapguideopensource/server#${MG_INSTALL_SERVER_PREFIX}#g" ${CMAKE_CURRENT_BINARY_DIR}/mapguidectl)
     install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mapguidectl DESTINATION ${MG_SERVER_BIN_DIR} COMPONENT ${MG_COMPONENT})
 endif (UNIX)
-configure_file(${CMAKE_MODULE_PATH}/../configs/serverconfig.ini.in ${CMAKE_CURRENT_BINARY_DIR}/serverconfig.ini)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/serverconfig.ini DESTINATION ${MG_SERVER_BIN_DIR} COMPONENT ${MG_COMPONENT})
+configure_file(${CMAKE_MODULE_PATH}/../configs/serverconfig.ini.in ${CMAKE_CURRENT_BINARY_DIR}/serverconfig_linux.ini)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/serverconfig_linux.ini DESTINATION ${MG_SERVER_BIN_DIR} COMPONENT ${MG_COMPONENT})
 configure_file(${CMAKE_MODULE_PATH}/../configs/mgserver.sh.in ${CMAKE_CURRENT_BINARY_DIR}/mgserver.sh)
 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mgserver.sh DESTINATION ${MG_SERVER_BIN_DIR} COMPONENT ${MG_COMPONENT})
 configure_file(${CMAKE_MODULE_PATH}/../configs/mgserverd.sh.in ${CMAKE_CURRENT_BINARY_DIR}/mgserverd.sh)

Modified: sandbox/jng/cmake_v2/Server/src/UnitTesting/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Server/src/UnitTesting/CMakeLists.txt	2018-01-10 07:33:00 UTC (rev 9304)
+++ sandbox/jng/cmake_v2/Server/src/UnitTesting/CMakeLists.txt	2018-01-10 09:28:03 UTC (rev 9305)
@@ -44,10 +44,9 @@
     UnitTesting.cpp
 )
 
-add_library(MgUnitTesting${MG_VERSION_SUFFIX} SHARED ${MgUnitTesting_SRCS})
-install(TARGETS MgUnitTesting${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
-install_symlink(${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libMgUnitTesting${MG_VERSION_SUFFIX}.so libMgUnitTesting.so ${MG_COMPONENT})
+add_library(MgUnitTesting SHARED ${MgUnitTesting_SRCS})
+install(TARGETS MgUnitTesting DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
 
-target_link_libraries(MgUnitTesting${MG_VERSION_SUFFIX}
-    ${CPPUNIT_LIBRARY}
+target_link_libraries(MgUnitTesting
+    ${CPPUNIT_LIBRARIES}
 )
\ No newline at end of file



More information about the mapguide-commits mailing list