qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1536857 - in /qpid/trunk/qpid/cpp/src: CMakeLists.txt msvc.cmake
Date Tue, 29 Oct 2013 19:20:47 GMT
Author: chug
Date: Tue Oct 29 19:20:46 2013
New Revision: 1536857

URL: http://svn.apache.org/r1536857
Log:
QPID-5274: Create separate cmake file for windows-specific functions.

Added:
    qpid/trunk/qpid/cpp/src/msvc.cmake
Modified:
    qpid/trunk/qpid/cpp/src/CMakeLists.txt

Modified: qpid/trunk/qpid/cpp/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/CMakeLists.txt?rev=1536857&r1=1536856&r2=1536857&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/CMakeLists.txt Tue Oct 29 19:20:46 2013
@@ -63,112 +63,8 @@ find_package_handle_standard_args(SASL D
 
 #set (CMAKE_VERBOSE_MAKEFILE ON)  # for debugging
 
-#
-# Set up installation of .pdb files if the compiler is Visual Studio
-#
-# Sample: install_pdb (qpidcommon ${QPID_COMPONENT_COMMON})
-#
-MACRO (install_pdb theLibrary theComponent)
-    if (MSVC)
-        get_target_property(library_dll ${theLibrary} LOCATION)
-        string(REPLACE .dll .pdb library_pdb ${library_dll})
-        string(REPLACE $(OutDir)        \${CMAKE_INSTALL_CONFIG_NAME} library_pdb ${library_pdb})
-        string(REPLACE $(Configuration) \${CMAKE_INSTALL_CONFIG_NAME} library_pdb ${library_pdb})
-        string(REPLACE .pdb d.pdb libraryd_pdb ${library_pdb})
-        #message(STATUS "_pdb: ${library_pdb}, ${libraryd_pdb}")
-        install (PROGRAMS
-                ${library_pdb}
-                DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
-                COMPONENT ${theComponent}
-                OPTIONAL
-                CONFIGURATIONS Release|MinSizeRel)
-        install (PROGRAMS
-                ${library_pdb}
-                DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
-                COMPONENT ${theComponent}
-                CONFIGURATIONS RelWithDebInfo)
-        install (PROGRAMS
-                ${libraryd_pdb}
-                DESTINATION ${QPID_INSTALL_LIBDIR}/DebugPDB
-                COMPONENT ${theComponent}
-                CONFIGURATIONS Debug)
-    endif (MSVC)
-ENDMACRO (install_pdb)
-
-#
-# inherit_value - if the symbol is undefined then set it to the given value.
-# Set flag to indicate this symbol was defined here.
-#
-MACRO (inherit_value theSymbol theValue)
-    if (NOT DEFINED ${theSymbol})
-        set (${theSymbol} ${theValue})
-        # message ("Set symbol '${theSymbol}' to value '${theValue}'")
-        set (${theSymbol}_inherited = "true")
-    endif (NOT DEFINED ${theSymbol})
-ENDMACRO (inherit_value)
-
-#
-# If compiler is Visual Studio then create a "version resource" for the project.
-# Use this call to override CPACK and file global settings but not file per-project settings.
-# Two groups of four version numbers specify "file" and "product" versions separately.
-#
-# Sample: add_msvc_version_full (qmfengine library dll 1 0 0 1 1 0 0 1)
-#
-MACRO (add_msvc_version_full verProject verProjectType verProjectFileExt verFN1 verFN2 verFN3
verFN4 verPN1 verPN2 verPN3 verPN4)
-    if (MSVC)
-        # Create project-specific version strings
-        inherit_value ("winver_${verProject}_FileVersionBinary"    "${verFN1},${verFN2},${verFN3},${verFN4}")
-        inherit_value ("winver_${verProject}_ProductVersionBinary" "${verPN1},${verPN2},${verPN3},${verPN4}")
-        inherit_value ("winver_${verProject}_FileVersionString"    "${verFN1}, ${verFN2},
${verFN3}, ${verFN4}")
-        inherit_value ("winver_${verProject}_ProductVersionString" "${verPN1}, ${verPN2},
${verPN3}, ${verPN4}")
-        inherit_value ("winver_${verProject}_FileDescription"      "${winver_PACKAGE_NAME}-${verProject}
${verProjectType}")
-        inherit_value ("winver_${verProject}_LegalCopyright"       "${winver_LEGAL_COPYRIGHT}")
-        inherit_value ("winver_${verProject}_InternalName"         "${verProject}")
-        inherit_value ("winver_${verProject}_OriginalFilename"     "${verProject}.${verProjectFileExt}")
-        inherit_value ("winver_${verProject}_ProductName"          "${winver_DESCRIPTION_SUMMARY}")
-
-        # Create strings to be substituted into the template file
-        set ("winverFileVersionBinary"     "${winver_${verProject}_FileVersionBinary}")
-        set ("winverProductVersionBinary"  "${winver_${verProject}_ProductVersionBinary}")
-        set ("winverFileVersionString"     "${winver_${verProject}_FileVersionString}")
-        set ("winverProductVersionString"  "${winver_${verProject}_ProductVersionString}")
-        set ("winverFileDescription"       "${winver_${verProject}_FileDescription}")
-        set ("winverLegalCopyright"        "${winver_${verProject}_LegalCopyright}")
-        set ("winverInternalName"          "${winver_${verProject}_InternalName}")
-        set ("winverOriginalFilename"      "${winver_${verProject}_OriginalFilename}")
-        set ("winverProductName"           "${winver_${verProject}_ProductName}")
-
-        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/resources/template-resource.rc
-                       ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/${verProject}-resource.rc)
-        set (${verProject}_SOURCES
-            ${${verProject}_SOURCES}
-            ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/${verProject}-resource.rc
-        )
-    endif (MSVC)
-ENDMACRO (add_msvc_version_full)
-
-#
-# If compiler is Visual Studio then create a "version resource" for the project.
-# Use this call to accept file override version settings or
-#  inherited CPACK_PACKAGE_VERSION version settings.
-#
-# Sample: add_msvc_version (qpidcommon library dll)
-#
-MACRO (add_msvc_version verProject verProjectType verProjectFileExt)
-    if (MSVC)
-        add_msvc_version_full (${verProject}
-                               ${verProjectType}
-                               ${verProjectFileExt}
-                               ${winver_FILE_VERSION_N1}
-                               ${winver_FILE_VERSION_N2}
-                               ${winver_FILE_VERSION_N3}
-                               ${winver_FILE_VERSION_N4}
-                               ${winver_PRODUCT_VERSION_N1}
-                               ${winver_PRODUCT_VERSION_N2}
-                               ${winver_PRODUCT_VERSION_N3}
-                               ${winver_PRODUCT_VERSION_N4})
-    endif (MSVC)
-ENDMACRO (add_msvc_version)
+# Define windows versions and library helpers
+include (msvc.cmake)
 
 # Add a test to check the exported library API against expected API symbols
 MACRO (add_api_test libname)
@@ -178,27 +74,6 @@ MACRO (add_api_test libname)
 ENDMACRO (add_api_test libname)
 
 
-#
-# Install optional windows version settings. Override variables are specified in a file.
-#
-include (./CMakeWinVersions.cmake OPTIONAL)
-
-#
-# Inherit global windows version settings from CPACK settings.
-#
-inherit_value ("winver_PACKAGE_NAME"         "${CPACK_PACKAGE_NAME}")
-inherit_value ("winver_DESCRIPTION_SUMMARY"  "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
-inherit_value ("winver_FILE_VERSION_N1"      "${CPACK_PACKAGE_VERSION_MAJOR}")
-inherit_value ("winver_FILE_VERSION_N2"      "${CPACK_PACKAGE_VERSION_MINOR}")
-inherit_value ("winver_FILE_VERSION_N3"      "${CPACK_PACKAGE_VERSION_PATCH}")
-inherit_value ("winver_FILE_VERSION_N4"      "1")
-inherit_value ("winver_PRODUCT_VERSION_N1"   "${winver_FILE_VERSION_N1}")
-inherit_value ("winver_PRODUCT_VERSION_N2"   "${winver_FILE_VERSION_N2}")
-inherit_value ("winver_PRODUCT_VERSION_N3"   "${winver_FILE_VERSION_N3}")
-inherit_value ("winver_PRODUCT_VERSION_N4"   "${winver_FILE_VERSION_N4}")
-inherit_value ("winver_LEGAL_COPYRIGHT"      "")
-
-
 # check if we generate source as part of the build
 #   - rubygen generates the amqp spec
 #   - managementgen generates the broker management code

Added: qpid/trunk/qpid/cpp/src/msvc.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/msvc.cmake?rev=1536857&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/msvc.cmake (added)
+++ qpid/trunk/qpid/cpp/src/msvc.cmake Tue Oct 29 19:20:46 2013
@@ -0,0 +1,149 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This file provides library support for MSVC builds.
+#  * Allows for detailed specification of file/product versions.
+#  * Installs PDB files.
+
+#
+# If the compiler is Visual Studio set up installation of .pdb files 
+#
+# Sample: install_pdb (qpidcommon ${QPID_COMPONENT_COMMON})
+#
+MACRO (install_pdb theLibrary theComponent)
+    if (MSVC)
+        get_target_property(library_dll ${theLibrary} LOCATION)
+        string(REPLACE .dll .pdb library_pdb ${library_dll})
+        string(REPLACE $(OutDir)        \${CMAKE_INSTALL_CONFIG_NAME} library_pdb ${library_pdb})
+        string(REPLACE $(Configuration) \${CMAKE_INSTALL_CONFIG_NAME} library_pdb ${library_pdb})
+        string(REPLACE .pdb d.pdb libraryd_pdb ${library_pdb})
+        #message(STATUS "_pdb: ${library_pdb}, ${libraryd_pdb}")
+        install (PROGRAMS
+                ${library_pdb}
+                DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
+                COMPONENT ${theComponent}
+                OPTIONAL
+                CONFIGURATIONS Release|MinSizeRel)
+        install (PROGRAMS
+                ${library_pdb}
+                DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
+                COMPONENT ${theComponent}
+                CONFIGURATIONS RelWithDebInfo)
+        install (PROGRAMS
+                ${libraryd_pdb}
+                DESTINATION ${QPID_INSTALL_LIBDIR}/DebugPDB
+                COMPONENT ${theComponent}
+                CONFIGURATIONS Debug)
+    endif (MSVC)
+ENDMACRO (install_pdb)
+
+#
+# inherit_value - if the symbol is undefined then set it to the given value.
+# Set flag to indicate this symbol was defined here.
+#
+MACRO (inherit_value theSymbol theValue)
+    if (NOT DEFINED ${theSymbol})
+        set (${theSymbol} ${theValue})
+        # message ("Set symbol '${theSymbol}' to value '${theValue}'")
+        set (${theSymbol}_inherited = "true")
+    endif (NOT DEFINED ${theSymbol})
+ENDMACRO (inherit_value)
+
+#
+# If compiler is Visual Studio then create a "version resource" for the project.
+# Use this call to override CPACK and file global settings but not file per-project settings.
+# Two groups of four version numbers specify "file" and "product" versions separately.
+#
+# Sample: add_msvc_version_full (qmfengine library dll 1 0 0 1 1 0 0 1)
+#
+MACRO (add_msvc_version_full verProject verProjectType verProjectFileExt verFN1 verFN2 verFN3
verFN4 verPN1 verPN2 verPN3 verPN4)
+    if (MSVC)
+        # Create project-specific version strings
+        inherit_value ("winver_${verProject}_FileVersionBinary"    "${verFN1},${verFN2},${verFN3},${verFN4}")
+        inherit_value ("winver_${verProject}_ProductVersionBinary" "${verPN1},${verPN2},${verPN3},${verPN4}")
+        inherit_value ("winver_${verProject}_FileVersionString"    "${verFN1}, ${verFN2},
${verFN3}, ${verFN4}")
+        inherit_value ("winver_${verProject}_ProductVersionString" "${verPN1}, ${verPN2},
${verPN3}, ${verPN4}")
+        inherit_value ("winver_${verProject}_FileDescription"      "${winver_PACKAGE_NAME}-${verProject}
${verProjectType}")
+        inherit_value ("winver_${verProject}_LegalCopyright"       "${winver_LEGAL_COPYRIGHT}")
+        inherit_value ("winver_${verProject}_InternalName"         "${verProject}")
+        inherit_value ("winver_${verProject}_OriginalFilename"     "${verProject}.${verProjectFileExt}")
+        inherit_value ("winver_${verProject}_ProductName"          "${winver_DESCRIPTION_SUMMARY}")
+
+        # Create strings to be substituted into the template file
+        set ("winverFileVersionBinary"     "${winver_${verProject}_FileVersionBinary}")
+        set ("winverProductVersionBinary"  "${winver_${verProject}_ProductVersionBinary}")
+        set ("winverFileVersionString"     "${winver_${verProject}_FileVersionString}")
+        set ("winverProductVersionString"  "${winver_${verProject}_ProductVersionString}")
+        set ("winverFileDescription"       "${winver_${verProject}_FileDescription}")
+        set ("winverLegalCopyright"        "${winver_${verProject}_LegalCopyright}")
+        set ("winverInternalName"          "${winver_${verProject}_InternalName}")
+        set ("winverOriginalFilename"      "${winver_${verProject}_OriginalFilename}")
+        set ("winverProductName"           "${winver_${verProject}_ProductName}")
+
+        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/resources/template-resource.rc
+                       ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/${verProject}-resource.rc)
+        set (${verProject}_SOURCES
+            ${${verProject}_SOURCES}
+            ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/${verProject}-resource.rc
+        )
+    endif (MSVC)
+ENDMACRO (add_msvc_version_full)
+
+#
+# If compiler is Visual Studio then create a "version resource" for the project.
+# Use this call to accept file override version settings or
+#  inherited CPACK_PACKAGE_VERSION version settings.
+#
+# Sample: add_msvc_version (qpidcommon library dll)
+#
+MACRO (add_msvc_version verProject verProjectType verProjectFileExt)
+    if (MSVC)
+        add_msvc_version_full (${verProject}
+                               ${verProjectType}
+                               ${verProjectFileExt}
+                               ${winver_FILE_VERSION_N1}
+                               ${winver_FILE_VERSION_N2}
+                               ${winver_FILE_VERSION_N3}
+                               ${winver_FILE_VERSION_N4}
+                               ${winver_PRODUCT_VERSION_N1}
+                               ${winver_PRODUCT_VERSION_N2}
+                               ${winver_PRODUCT_VERSION_N3}
+                               ${winver_PRODUCT_VERSION_N4})
+    endif (MSVC)
+ENDMACRO (add_msvc_version)
+
+#
+# Install optional windows version settings. Override variables are specified in a file.
+#
+include (./CMakeWinVersions.cmake OPTIONAL)
+
+#
+# Inherit global windows version settings from CPACK settings.
+#
+inherit_value ("winver_PACKAGE_NAME"         "${CPACK_PACKAGE_NAME}")
+inherit_value ("winver_DESCRIPTION_SUMMARY"  "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
+inherit_value ("winver_FILE_VERSION_N1"      "${CPACK_PACKAGE_VERSION_MAJOR}")
+inherit_value ("winver_FILE_VERSION_N2"      "${CPACK_PACKAGE_VERSION_MINOR}")
+inherit_value ("winver_FILE_VERSION_N3"      "${CPACK_PACKAGE_VERSION_PATCH}")
+inherit_value ("winver_FILE_VERSION_N4"      "1")
+inherit_value ("winver_PRODUCT_VERSION_N1"   "${winver_FILE_VERSION_N1}")
+inherit_value ("winver_PRODUCT_VERSION_N2"   "${winver_FILE_VERSION_N2}")
+inherit_value ("winver_PRODUCT_VERSION_N3"   "${winver_FILE_VERSION_N3}")
+inherit_value ("winver_PRODUCT_VERSION_N4"   "${winver_FILE_VERSION_N4}")
+inherit_value ("winver_LEGAL_COPYRIGHT"      "")



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message