You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/03/16 23:36:25 UTC

svn commit: r1735324 - in /qpid/trunk/qpid/cpp: ./ bindings/qmf2/examples/cpp/ docs/api/ examples/ examples/messaging/extra_dist/ examples/winsdk-cmake/ managementgen/ src/ src/tests/ src/tests/legacystore/

Author: astitcher
Date: Wed Mar 16 22:36:24 2016
New Revision: 1735324

URL: http://svn.apache.org/viewvc?rev=1735324&view=rev
Log:
QPID-7148: Update CMake files to use better more modern style and features
- This is already the way we do this stuff in Qpid Proton
- Upgrade minimum version of CMake to 2.8.7

Modified:
    qpid/trunk/qpid/cpp/CMakeLists.txt
    qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt
    qpid/trunk/qpid/cpp/docs/api/CMakeLists.txt
    qpid/trunk/qpid/cpp/examples/CMakeLists.txt
    qpid/trunk/qpid/cpp/examples/messaging/extra_dist/CMakeLists.txt
    qpid/trunk/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt
    qpid/trunk/qpid/cpp/managementgen/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/msvc.cmake
    qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt

Modified: qpid/trunk/qpid/cpp/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -17,25 +17,26 @@
 # under the License.
 #
 
-# Set default build type. Must come before project() which sets default to ""
-set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE string
-  "Build type: Debug, Release, RelWithDebInfo or MinSizeRel (default RelWithDebInfo)")
-if (CMAKE_BUILD_TYPE MATCHES "Deb")
-  set (has_debug_symbols " (has debug symbols)")
-endif (CMAKE_BUILD_TYPE MATCHES "Deb")
-
 project(qpid-cpp)
 
-cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
-if(COMMAND cmake_policy)
-  cmake_policy(VERSION 2.6)
-endif(COMMAND cmake_policy)
-
-if (${CMAKE_VERSION} VERSION_LESS "2.8.0")
-    set (OPTIONAL_ARG "")
-else()
-    set (OPTIONAL_ARG OPTIONAL)
-endif()
+cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
+
+if (CMAKE_CONFIGURATION_TYPES)
+  # There is no single "build type"...
+  message(STATUS "Build types are ${CMAKE_CONFIGURATION_TYPES}")
+else (CMAKE_CONFIGURATION_TYPES)
+  # There is a single build configuration
+  # If the build type is not set then set the default
+  if (NOT CMAKE_BUILD_TYPE)
+  set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE string
+       "Build type: Debug, Release, RelWithDebInfo or MinSizeRel (default RelWithDebInfo)" FORCE)
+  endif ()
+
+  if (CMAKE_BUILD_TYPE MATCHES "Deb")
+    set (has_debug_symbols " (has debug symbols)")
+  endif (CMAKE_BUILD_TYPE MATCHES "Deb")
+  message(STATUS "Build type is \"${CMAKE_BUILD_TYPE}\"${has_debug_symbols}")
+endif (CMAKE_CONFIGURATION_TYPES)
 
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
 
@@ -107,13 +108,7 @@ set(CPACK_PACKAGE_VERSION_PATCH "0")
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "qpidc-${qpidc_version}")
 
 # Add custom target for docs since we don't include a cmake file there directly.
-# If we can't use OPTIONAL in the install command then we have to make the docs
-# every time so that the install target succeeds
-if (OPTIONAL_ARG)
-  add_custom_target(docs)
-else (OPTIONAL_ARG)
-  add_custom_target(docs ALL)
-endif (OPTIONAL_ARG)
+add_custom_target(docs)
 
 # uninstall target
 configure_file(
@@ -239,7 +234,3 @@ add_subdirectory(docs/man)
 add_subdirectory(examples)
 
 include (CPack)
-
-# Build type message again, last so it is visible at end of output.
-message(STATUS "Build type is \"${CMAKE_BUILD_TYPE}\"${has_debug_symbols}")
-

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -17,10 +17,7 @@
 # under the License.
 #
 project(qmf2_examples)
-cmake_minimum_required(VERSION 2.4.0 FATAL_ERROR)
-if(COMMAND cmake_policy)
-  cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
+cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
 
 include_directories(${CMAKE_BINARY_DIR}/include)
 include_directories(${CMAKE_SOURCE_DIR}/include)

Modified: qpid/trunk/qpid/cpp/docs/api/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/docs/api/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/docs/api/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/docs/api/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -36,7 +36,7 @@ if (BUILD_DOCS)
     install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
              DESTINATION ${QPID_INSTALL_DOCDIR}/api/html
              COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}
-             ${OPTIONAL_ARG})
+             OPTIONAL)
     if (CPACK_GENERATOR STREQUAL "NSIS")
         set (CPACK_NSIS_MENU_LINKS
              "${QPID_INSTALL_HTMLDIR}/index.html" "Qpid C++ API Documentation"

Modified: qpid/trunk/qpid/cpp/examples/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/examples/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -17,10 +17,7 @@
 # under the License.
 #
 project(qpidc_examples)
-cmake_minimum_required(VERSION 2.4.0 FATAL_ERROR)
-if(COMMAND cmake_policy)
-  cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
+cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
 
 include_directories(${CMAKE_BINARY_DIR}/include)
 include_directories(${CMAKE_SOURCE_DIR}/include)

Modified: qpid/trunk/qpid/cpp/examples/messaging/extra_dist/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/extra_dist/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/extra_dist/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/examples/messaging/extra_dist/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 2.8.7)
 
 project (Examples)
 

Modified: qpid/trunk/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -1,95 +1,94 @@
-#
-# 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.
-#
-
-#
-# Description
-#   For WinSDK:
-#   Top-level CMake source to build version-independent C++ 
-#   example solution and project files for Visual Studio.
-#
-# Usage:
-#   Target: Visual Studio 2008, 32-bit
-#     cd    <WinSDK>\examples\examples-cmake
-#     cmake -G "Visual Studio 9 2008" .
-#
-#   Target: Visual Studio 2008, 64-bit
-#     cd    <WinSDK>\examples\examples-cmake
-#     cmake -G "Visual Studio 9 2008 Win64" .
-#
-#   Target: Visual Studio 2010, 32-bit
-#     cd    <WinSDK>\examples\examples-cmake
-#     cmake -G "Visual Studio 10" .
-#
-#   Target: Visual Studio 2010, 64-bit
-#     cd    <WinSDK>\examples\examples-cmake
-#     cmake -G "Visual Studio 10 Win64" .
-#
-#   Then execute the examples.sln created by cmake to build
-#   the examples in Debug or Release configurations.
-#
-
-project(examples)
-
-set (CMAKE_VERBOSE_MAKEFILE ON)
-
-cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
-cmake_policy (SET CMP0015 NEW)
-
-set (CMAKE_SUPPRESS_REGENERATION TRUE)
-
-add_definitions(
-  /D "_CRT_NONSTDC_NO_WARNINGS"
-  /D "NOMINMAX" 
-  /D "WIN32_LEAN_AND_MEAN" 
-)
-
-set (CMAKE_DEBUG_POSTFIX "d")
-
-include_directories      ( "../../include" )
-link_directories         ( "../../lib"     )
-
-macro(add_example_properties example)
-  set_target_properties(${example} PROPERTIES OUTPUT_NAME "${example}" )
-  set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../bin/${CMAKE_BUILD_TYPE})
-  
-  target_link_libraries(${example} optimized qpidmessaging debug qpidmessagingd)
-  target_link_libraries(${example} optimized qpidcommon    debug qpidcommond   )
-  target_link_libraries(${example} optimized qpidtypes     debug qpidtypesd    )
-endmacro(add_example_properties)
-
-macro(add_example srcdirectory example)
-  add_executable(${example} ../${srcdirectory}/${example}.cpp)
-  add_example_properties(${example})
-endmacro(add_example)
-
-macro(add_example_with_parser srcdirectory example)
-  add_executable(${example} ../${srcdirectory}/${example}.cpp ../messaging/OptionParser.cpp)
-  add_example_properties(${example})
-endmacro(add_example_with_parser)
-
-add_example_with_parser(messaging drain)
-add_example_with_parser(messaging spout)
-
-add_example(messaging map_receiver)
-add_example(messaging map_sender)
-add_example(messaging client)
-add_example(messaging server)
-add_example(messaging server_reconnect)
-add_example(messaging hello_world)
-add_example(messaging hello_xml)
+#
+# 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.
+#
+
+#
+# Description
+#   For WinSDK:
+#   Top-level CMake source to build version-independent C++ 
+#   example solution and project files for Visual Studio.
+#
+# Usage:
+#   Target: Visual Studio 2008, 32-bit
+#     cd    <WinSDK>\examples\examples-cmake
+#     cmake -G "Visual Studio 9 2008" .
+#
+#   Target: Visual Studio 2008, 64-bit
+#     cd    <WinSDK>\examples\examples-cmake
+#     cmake -G "Visual Studio 9 2008 Win64" .
+#
+#   Target: Visual Studio 2010, 32-bit
+#     cd    <WinSDK>\examples\examples-cmake
+#     cmake -G "Visual Studio 10" .
+#
+#   Target: Visual Studio 2010, 64-bit
+#     cd    <WinSDK>\examples\examples-cmake
+#     cmake -G "Visual Studio 10 Win64" .
+#
+#   Then execute the examples.sln created by cmake to build
+#   the examples in Debug or Release configurations.
+#
+
+project(examples)
+
+set (CMAKE_VERBOSE_MAKEFILE ON)
+
+cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
+
+set (CMAKE_SUPPRESS_REGENERATION TRUE)
+
+add_definitions(
+  /D "_CRT_NONSTDC_NO_WARNINGS"
+  /D "NOMINMAX" 
+  /D "WIN32_LEAN_AND_MEAN" 
+)
+
+set (CMAKE_DEBUG_POSTFIX "d")
+
+include_directories      ( "../../include" )
+link_directories         ( "../../lib"     )
+
+macro(add_example_properties example)
+  set_target_properties(${example} PROPERTIES OUTPUT_NAME "${example}" )
+  set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../bin/${CMAKE_BUILD_TYPE})
+  
+  target_link_libraries(${example} optimized qpidmessaging debug qpidmessagingd)
+  target_link_libraries(${example} optimized qpidcommon    debug qpidcommond   )
+  target_link_libraries(${example} optimized qpidtypes     debug qpidtypesd    )
+endmacro(add_example_properties)
+
+macro(add_example srcdirectory example)
+  add_executable(${example} ../${srcdirectory}/${example}.cpp)
+  add_example_properties(${example})
+endmacro(add_example)
+
+macro(add_example_with_parser srcdirectory example)
+  add_executable(${example} ../${srcdirectory}/${example}.cpp ../messaging/OptionParser.cpp)
+  add_example_properties(${example})
+endmacro(add_example_with_parser)
+
+add_example_with_parser(messaging drain)
+add_example_with_parser(messaging spout)
+
+add_example(messaging map_receiver)
+add_example(messaging map_sender)
+add_example(messaging client)
+add_example(messaging server)
+add_example(messaging server_reconnect)
+add_example(messaging hello_world)
+add_example(messaging hello_xml)

Modified: qpid/trunk/qpid/cpp/managementgen/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/managementgen/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/managementgen/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/managementgen/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -20,7 +20,7 @@ option(INSTALL_QMFGEN "Install QMF-GEN a
 
 if (INSTALL_QMFGEN)
     project(qpidc-qmfgen)
-    cmake_minimum_required(VERSION 2.4.0 FATAL_ERROR)
+    cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
 
     find_package(PythonInterp REQUIRED)
 
@@ -37,4 +37,4 @@ if (INSTALL_QMFGEN)
             PATTERN ".svn" EXCLUDE PATTERN "*.pyc" EXCLUDE)
 else (INSTALL_QMFGEN)
     message (STATUS "Skipping installing qmf-gen and qmf python site-packages")
-endif (INSTALL_QMFGEN)
\ No newline at end of file
+endif (INSTALL_QMFGEN)

Modified: qpid/trunk/qpid/cpp/src/msvc.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/msvc.cmake?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/msvc.cmake (original)
+++ qpid/trunk/qpid/cpp/src/msvc.cmake Wed Mar 16 22:36:24 2016
@@ -1,149 +1,138 @@
-#
-# 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"      "")
+#
+# 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)
+        install (FILES
+                $<TARGET_PDB_FILE:${theLibrary}>
+                DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
+                COMPONENT ${theComponent}
+                OPTIONAL
+                CONFIGURATIONS Release MinSizeRel RelWithDebInfo)
+        install (FILES
+                $<TARGET_PDB_FILE:${theLibrary}>
+                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"      "")

Modified: qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -37,11 +37,6 @@ if (MSVC)
   add_definitions( /wd4275 /wd4503 /D_CRT_SECURE_NO_WARNINGS)
 endif (MSVC)
 
-# Macro to make it easier to remember where the tests are built
-macro(remember_location testname)
-  set (${testname}_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${testname}${CMAKE_EXECUTABLE_SUFFIX})
-endmacro(remember_location)
-
 # If we're using GCC allow variadic macros (even though they're c99 not c++01)
 if (CMAKE_COMPILER_IS_GNUCXX)
   add_definitions(-Wno-variadic-macros)
@@ -62,11 +57,9 @@ endif (CMAKE_SYSTEM_NAME STREQUAL Window
 # Some generally useful utilities that just happen to be built in the test area
 add_executable (qpid-receive qpid-receive.cpp Statistics.cpp ${platform_test_additions})
 target_link_libraries (qpid-receive qpidmessaging qpidtypes qpidcommon)
-remember_location(qpid-receive)
 
 add_executable (qpid-send qpid-send.cpp Statistics.cpp ${platform_test_additions})
 target_link_libraries (qpid-send qpidmessaging qpidtypes qpidcommon)
-remember_location(qpid-send)
 
 install (TARGETS
          qpid-receive qpid-send
@@ -74,45 +67,35 @@ install (TARGETS
 
 add_executable (qpid-perftest qpid-perftest.cpp ${platform_test_additions})
 target_link_libraries (qpid-perftest qpidclient qpidcommon ${Boost_PROGRAM_OPTIONS_LIBRARY})
-remember_location(qpid-perftest)
 
 add_executable (qpid-latency-test qpid-latency-test.cpp ${platform_test_additions})
 target_link_libraries (qpid-latency-test qpidclient qpidcommon)
-remember_location(qpid-latency-test)
 
 add_executable (qpid-client-test qpid-client-test.cpp ${platform_test_additions})
 target_link_libraries (qpid-client-test qpidclient qpidcommon)
-remember_location(qpid-client-test)
 
 add_executable (qpid-ping qpid-ping.cpp ${platform_test_additions})
 target_link_libraries (qpid-ping qpidmessaging qpidtypes qpidcommon)
-remember_location(qpid-ping)
 
 add_executable (qpid-topic-listener qpid-topic-listener.cpp ${platform_test_additions})
 target_link_libraries (qpid-topic-listener qpidclient qpidcommon)
-remember_location(qpid-topic-listener)
 
 add_executable (qpid-topic-publisher qpid-topic-publisher.cpp ${platform_test_additions})
 target_link_libraries (qpid-topic-publisher qpidclient qpidcommon)
-remember_location(qpid-topic-publisher)
 
 add_executable (receiver receiver.cpp ${platform_test_additions})
 target_link_libraries (receiver qpidclient qpidcommon)
-remember_location(receiver)
 
 # This is bizarre - using both messaging and client libraries
 add_executable (sender sender.cpp Statistics.cpp ${platform_test_additions})
 target_link_libraries (sender qpidmessaging qpidtypes qpidclient qpidcommon)
-remember_location(sender)
 
 add_executable (qpid-txtest qpid-txtest.cpp ${platform_test_additions})
 target_link_libraries (qpid-txtest qpidclient qpidcommon qpidtypes)
 #qpid_txtest_SOURCES=qpid-txtest.cpp  TestOptions.h ConnectionOptions.h
-remember_location(qpid-txtest)
 
 add_executable (qpid-txtest2 qpid-txtest2.cpp ${platform_test_additions})
 target_link_libraries (qpid-txtest2 qpidmessaging qpidtypes qpidcommon)
-remember_location(qpid-txtest2)
 
 install (TARGETS
          qpid-perftest qpid-latency-test qpid-client-test
@@ -240,9 +223,8 @@ target_link_libraries (unit_test
                        ${qpid_test_boost_libs}
                        qpidmessaging qpidtypes qpidbroker qpidclient qpidcommon)
 set_target_properties (unit_test PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
-remember_location(unit_test)
 
-add_test (unit_test ${test_wrap} -boostTest -- ${unit_test_LOCATION})
+add_test (NAME unit_test COMMAND ${test_wrap} -boostTest -- $<TARGET_FILE:unit_test>)
 
 endif (BUILD_TESTING_UNITTESTS)
 
@@ -263,55 +245,42 @@ endif (BUILD_SASL)
 #
 add_executable (echotest echotest.cpp ${platform_test_additions})
 target_link_libraries (echotest qpidclient qpidcommon)
-remember_location(echotest)
 
 add_executable (publish publish.cpp ${platform_test_additions})
 target_link_libraries (publish qpidclient qpidcommon)
-remember_location(publish)
 
 add_executable (consume consume.cpp ${platform_test_additions})
 target_link_libraries (consume qpidclient qpidcommon)
-remember_location(consume)
 
 add_executable (header_test header_test.cpp ${platform_test_additions})
 target_link_libraries (header_test qpidclient qpidcommon)
-remember_location(header_test)
 
 add_executable (declare_queues declare_queues.cpp ${platform_test_additions})
 target_link_libraries (declare_queues qpidclient qpidcommon)
-remember_location(declare_queues)
 
 add_executable (replaying_sender replaying_sender.cpp ${platform_test_additions})
 target_link_libraries (replaying_sender qpidclient qpidcommon)
-remember_location(replaying_sender)
 
 add_executable (resuming_receiver resuming_receiver.cpp ${platform_test_additions})
 target_link_libraries (resuming_receiver qpidclient qpidcommon)
-remember_location(resuming_receiver)
 
 add_executable (txshift txshift.cpp ${platform_test_additions})
 target_link_libraries (txshift qpidclient qpidcommon)
-remember_location(txshift)
 
 add_executable (txjob txjob.cpp ${platform_test_additions})
 target_link_libraries (txjob qpidclient qpidcommon)
-remember_location(txjob)
 
 add_executable (datagen datagen.cpp ${platform_test_additions})
 target_link_libraries (datagen qpidclient qpidcommon)
-remember_location(datagen)
 
 add_executable (msg_group_test msg_group_test.cpp ${platform_test_additions})
 target_link_libraries (msg_group_test qpidmessaging qpidtypes qpidcommon)
-remember_location(msg_group_test)
 
 add_executable (ha_test_max_queues ha_test_max_queues.cpp ${platform_test_additions})
 target_link_libraries (ha_test_max_queues qpidclient qpidcommon)
-remember_location(ha_test_max_queues)
 
 if (BUILD_SASL)
     add_executable (sasl_version sasl_version.cpp ${platform_test_additions})
-    remember_location(sasl_version)
 endif (BUILD_SASL)
 
 set (python_src ${CMAKE_SOURCE_DIR}/../python)
@@ -338,27 +307,27 @@ if (EXISTS ${python_src})
 endif (EXISTS ${python_src})
 
 if (BUILD_SASL)
-    add_test (sasl_fed ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed${test_script_suffix})
-    add_test (sasl_fed_ex_dynamic ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} dynamic)
-    add_test (sasl_fed_ex_link ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} link)
-    add_test (sasl_fed_ex_queue ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} queue)
-    add_test (sasl_fed_ex_route ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} route)
-    add_test (sasl_no_dir ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_no_dir${test_script_suffix})
+    add_test (NAME sasl_fed COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed${test_script_suffix})
+    add_test (NAME sasl_fed_ex_dynamic COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} dynamic)
+    add_test (NAME sasl_fed_ex_link COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} link)
+    add_test (NAME sasl_fed_ex_queue COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} queue)
+    add_test (NAME sasl_fed_ex_route COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} route)
+    add_test (NAME sasl_no_dir COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_no_dir${test_script_suffix})
     if (BUILD_SSL)
-        add_test(ssl_test ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/ssl_test${test_script_suffix})
+        add_test(NAME ssl_test COMMAND ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/ssl_test${test_script_suffix})
     endif (BUILD_SSL)
 endif (BUILD_SASL)
-add_test (qpid-client-test ${test_wrap} -startBroker -- ${qpid-client-test_LOCATION})
-add_test (quick_perftest ${test_wrap} -startBroker -- ${qpid-perftest_LOCATION} --summary --count 100)
-add_test (quick_topictest ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/quick_topictest${test_script_suffix})
-add_test (quick_txtest ${test_wrap} -startBroker -- ${qpid-txtest_LOCATION} --queues 4 --tx-count 10 --quiet)
-add_test (quick_txtest2 ${test_wrap} -startBroker -- ${qpid-txtest2_LOCATION} --queues 4 --tx-count 10 --quiet)
-add_test (msg_group_tests ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/run_msg_group_tests${test_script_suffix})
-add_test (run_header_test ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/run_header_test${test_script_suffix})
-add_test (python_tests ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/python_tests${test_script_suffix})
+add_test (NAME qpid-client-test COMMAND ${test_wrap} -startBroker -- $<TARGET_FILE:qpid-client-test>)
+add_test (NAME quick_perftest COMMAND ${test_wrap} -startBroker -- $<TARGET_FILE:qpid-perftest> --summary --count 100)
+add_test (NAME quick_topictest COMMAND ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/quick_topictest${test_script_suffix})
+add_test (NAME quick_txtest COMMAND ${test_wrap} -startBroker -- $<TARGET_FILE:qpid-txtest> --queues 4 --tx-count 10 --quiet)
+add_test (NAME quick_txtest2 COMMAND ${test_wrap} -startBroker -- $<TARGET_FILE:qpid-txtest2> --queues 4 --tx-count 10 --quiet)
+add_test (NAME msg_group_tests COMMAND ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/run_msg_group_tests${test_script_suffix})
+add_test (NAME run_header_test COMMAND ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/run_header_test${test_script_suffix})
+add_test (NAME python_tests COMMAND ${test_wrap} -startBroker -- ${CMAKE_CURRENT_SOURCE_DIR}/python_tests${test_script_suffix})
 if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
   # paged queue not yet implemented for windows
-  add_test (paged_queue_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_paged_queue_tests${test_script_suffix})
+  add_test (NAME paged_queue_tests COMMAND ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_paged_queue_tests${test_script_suffix})
 endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
 
 if (BUILD_AMQP)

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt?rev=1735324&r1=1735323&r2=1735324&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt Wed Mar 16 22:36:24 2016
@@ -53,8 +53,7 @@ target_link_libraries (${testname}
 if ("${ARGV1}" STREQUAL "LONG")
   set_target_properties(${testname} PROPERTIES COMPILE_DEFINITIONS LONG_TEST)
 endif ()
-remember_location(${testname})
-add_test (${testname} ${test_wrap} -boostTest -- ${${testname}_LOCATION})
+add_test (NAME ${testname} COMMAND ${test_wrap} -boostTest -- $<TARGET_FILE:${testname}>)
 unset (testname)
 ENDMACRO (define_journal_test)
 




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