summaryrefslogtreecommitdiff
path: root/qpid/cpp/examples
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2011-11-23 23:54:15 +0000
committerCharles E. Rolke <chug@apache.org>2011-11-23 23:54:15 +0000
commit1e320902f61528648056f958ba45535d85b921e1 (patch)
tree702cbf0f834f4875ad3e4dd83dc097d2004c5d29 /qpid/cpp/examples
parenta0ec07cea3c8b75d656599bfee41df56045e345c (diff)
downloadqpid-python-1e320902f61528648056f958ba45535d85b921e1.tar.gz
QPID-2643 Visual Studio 2010
Add a standalone cmakelists.txt file to be used for building a WinSDK. Currently the cpp/examples area has hard-coded sln and vcproj files which don't work under VS2010. This new cmakelists.txt is used to generate a proper sln/vcproj or sln/vcxproj for each example in the SDK. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1205667 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/examples')
-rw-r--r--qpid/cpp/examples/winsdk-cmake/CMakeLists.txt115
1 files changed, 115 insertions, 0 deletions
diff --git a/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt b/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt
new file mode 100644
index 0000000000..6f0c28ca60
--- /dev/null
+++ b/qpid/cpp/examples/winsdk-cmake/CMakeLists.txt
@@ -0,0 +1,115 @@
+#
+# 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.
+#
+
+#
+# For making WinSDK example solution and project files:
+# Top-level CMake source to build version-independent C++
+# example solution and project files for Visual Studio.
+#
+# mkdir msvc9-win32
+# cd msvc9-win32
+# cmake -G "Visual Studio 9 2008" ..\cmake
+# cd ..
+#
+# mkdir msvc9-x64
+# cd msvc9-x64
+# cmake -G "Visual Studio 9 2008 x64" ..\cmake
+# cd ..
+#
+
+project(examples)
+
+set (CMAKE_VERBOSE_MAKEFILE ON) # for debugging
+
+cmake_minimum_required(VERSION 2.4.0 FATAL_ERROR)
+
+#
+# This script supports settings for the WinSDK build and
+# for a normal source build.
+#
+option (BUILD_WINSDK
+ "Generate for the WinSDK packaged environment" ON)
+
+set (CMAKE_SUPPRESS_REGENERATION TRUE)
+
+add_definitions(
+ /D "_CRT_NONSTDC_NO_WARNINGS"
+ /D "NOMINMAX"
+ /D "WIN32_LEAN_AND_MEAN"
+)
+
+set (CMAKE_DEBUG_POSTFIX "d")
+
+set (CMAKE_CONFIGURATION_TYPES Debug Release)
+
+if (BUILD_WINSDK)
+ # Set for WinSDK builds
+ message(STATUS "BUILD_WINSDK is ON")
+ set (includeDirs "../../include")
+ set (linkDirs "../../lib")
+else (BUILD_WINSDK)
+ # Set for in-source builds
+ message(STATUS "BUILD_WINSDK is OFF")
+ set (includeDirs "$(QPID_ROOT)/include;../../include")
+ set (linkDirs "$(QPID_ROOT)/src/$(Configuration);../../lib")
+endif (BUILD_WINSDK)
+
+
+include_directories ( ${includeDirs} )
+link_directories ( ${linkDirs} )
+
+macro(add_example_properties example)
+ set_target_properties(${example} PROPERTIES OUTPUT_NAME "${example}" )
+ IF (BUILD_WINSDK)
+ set_target_properties(${example} PROPERTIES PREFIX "../../../bin/")
+ ENDIF (BUILD_WINSDK)
+
+ target_link_libraries(${example} qpidmessaging debug qpidmessagingd)
+ target_link_libraries(${example} qpidcommon debug qpidcommond)
+ target_link_libraries(${example} 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)
+
+if (NOT BUILD_WINSDK)
+ add_example(messaging hello_world)
+ add_example(messaging hello_xml)
+
+ add_example(qmf-console console)
+ add_example(qmf-console ping)
+ add_example(qmf-console printevents)
+ add_example(qmf-console queuestats)
+
+endif (NOT BUILD_WINSDK)