[mapguide-commits] r9300 - in sandbox/jng/cmake_v2: . Common Server/src/Common/Manager Server/src/Core cmake/configs

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jan 9 05:22:43 PST 2018


Author: jng
Date: 2018-01-09 05:22:43 -0800 (Tue, 09 Jan 2018)
New Revision: 9300

Added:
   sandbox/jng/cmake_v2/cmake/configs/ProductVersion.h.in
Modified:
   sandbox/jng/cmake_v2/CMakeLists.txt
   sandbox/jng/cmake_v2/Common/CMakeLists.txt
   sandbox/jng/cmake_v2/Server/src/Common/Manager/CMakeLists.txt
   sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt
Log:
Do not use Common/ProductVersion.h. Instead have a template copy of this file and stamp it with CMake version variables to some auto-generated header directory and make sure this directory is included in any consuming projects of this particular header

Modified: sandbox/jng/cmake_v2/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/CMakeLists.txt	2018-01-09 12:30:07 UTC (rev 9299)
+++ sandbox/jng/cmake_v2/CMakeLists.txt	2018-01-09 13:22:43 UTC (rev 9300)
@@ -40,6 +40,9 @@
 set(MG_VERSION_MAJOR 3)
 set(MG_VERSION_MINOR 3)
 set(MG_VERSION_RELEASE 0)
+if (NOT MG_VERSION_REV)
+    set(MG_VERSION_REV 0)
+endif (NOT MG_VERSION_REV)
 set(MG_VERSION "${MG_VERSION_MAJOR}.${MG_VERSION_MINOR}.${MG_VERSION_RELEASE}")
 
 set(MG_HTTPD_PORT 8008)
@@ -63,6 +66,8 @@
 set(MG_SERVER_SERVICES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Server/src/Services")
 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_COMPONENT_COMMON "common")
 set(MG_COMPONENT_SERVER "server")
 set(MG_COMPONENT_WEB "web")

Modified: sandbox/jng/cmake_v2/Common/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Common/CMakeLists.txt	2018-01-09 12:30:07 UTC (rev 9299)
+++ sandbox/jng/cmake_v2/Common/CMakeLists.txt	2018-01-09 13:22:43 UTC (rev 9300)
@@ -18,4 +18,6 @@
 add_subdirectory(Security)
 add_subdirectory(Stylization)
 
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Schema DESTINATION ${MG_INSTALL_SERVER_PREFIX} COMPONENT ${MG_COMPONENT_SERVER})
\ No newline at end of file
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Schema DESTINATION ${MG_INSTALL_SERVER_PREFIX} COMPONENT ${MG_COMPONENT_SERVER})
+
+configure_file(${CMAKE_MODULE_PATH}/../configs/ProductVersion.h.in ${MG_AUTO_GENERATED_HEADER_DIR}/ProductVersion.h)
\ No newline at end of file

Modified: sandbox/jng/cmake_v2/Server/src/Common/Manager/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Server/src/Common/Manager/CMakeLists.txt	2018-01-09 12:30:07 UTC (rev 9299)
+++ sandbox/jng/cmake_v2/Server/src/Common/Manager/CMakeLists.txt	2018-01-09 13:22:43 UTC (rev 9300)
@@ -1,7 +1,7 @@
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}
     ${ACE_INCLUDE_DIR}
     ${FDO_INCLUDE_DIR}
-    ${MG_COMMON_DIR}
+    ${MG_AUTO_GENERATED_HEADER_DIR}
     ${MG_COMMON_DIR}/MdfModel
     ${MG_COMMON_DIR}/MdfParser
     ${MG_COMMON_DIR}/Security

Modified: sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt	2018-01-09 12:30:07 UTC (rev 9299)
+++ sandbox/jng/cmake_v2/Server/src/Core/CMakeLists.txt	2018-01-09 13:22:43 UTC (rev 9300)
@@ -5,7 +5,7 @@
     ${DBXML_INCLUDE_DIR}
     ${FDO_INCLUDE_DIR}
     ${FDO_INCLUDE_DIR}/ExpressionEngine
-    ${MG_COMMON_DIR}
+    ${MG_AUTO_GENERATED_HEADER_DIR}
     ${MG_COMMON_DIR}/CoordinateSystem
     ${MG_COMMON_DIR}/Security
     ${MG_COMMON_DIR}/MdfModel
@@ -76,7 +76,11 @@
     MgRenderers${MG_VERSION_SUFFIX}
 )
 install(TARGETS mgserver DESTINATION ${MG_SERVER_BIN_DIR} COMPONENT ${MG_COMPONENT})
-install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mapguidectl 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/mgserver.sh.in ${CMAKE_CURRENT_BINARY_DIR}/mgserver.sh)

Added: sandbox/jng/cmake_v2/cmake/configs/ProductVersion.h.in
===================================================================
--- sandbox/jng/cmake_v2/cmake/configs/ProductVersion.h.in	                        (rev 0)
+++ sandbox/jng/cmake_v2/cmake/configs/ProductVersion.h.in	2018-01-09 13:22:43 UTC (rev 9300)
@@ -0,0 +1,24 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef PRODUCTVERSION_H_
+#define PRODUCTVERSION_H_
+
+const STRING ProductVersion = L"@MG_VERSION_MAJOR at .@MG_VERSION_MINOR at .@MG_VERSION_RELEASE at .@MG_VERSION_REV@";
+const STRING ApiVersion     = L"@MG_VERSION_MAJOR at .@MG_VERSION_MINOR@";  // Major.Minor only
+
+#endif // PRODUCTVERSION_H_



More information about the mapguide-commits mailing list