diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-05-27 15:44:23 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-05-27 15:44:23 +0000 |
commit | 66765100f4257159622cefe57bed50125a5ad017 (patch) | |
tree | a88ee23bb194eb91f0ebb2d9b23ff423e3ea8e37 /qpid/cpp/examples/CMakeLists.txt | |
parent | 1aeaa7b16e5ce54f10c901d75c4d40f9f88b9db6 (diff) | |
parent | 88b98b2f4152ef59a671fad55a0d08338b6b78ca (diff) | |
download | qpid-python-66765100f4257159622cefe57bed50125a5ad017.tar.gz |
Creating a branch for experimenting with some ideas for JMS client.rajith_jms_client
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rajith_jms_client@1128369 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/examples/CMakeLists.txt')
-rw-r--r-- | qpid/cpp/examples/CMakeLists.txt | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/qpid/cpp/examples/CMakeLists.txt b/qpid/cpp/examples/CMakeLists.txt new file mode 100644 index 0000000000..1b28cfd031 --- /dev/null +++ b/qpid/cpp/examples/CMakeLists.txt @@ -0,0 +1,90 @@ +# +# 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. +# +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) + +include_directories(${CMAKE_BINARY_DIR}/include) +include_directories(${CMAKE_SOURCE_DIR}/include) + +# Shouldn't need this... but there are still client header inclusions +# of Boost. When building examples at an install site, the Boost files +# should be locatable aside from these settings. +# So set up to find the headers, find the libs at link time, but dynamically +# link them all and clear the CMake Boost library names to avoid adding them to +# the project files. +include_directories( ${Boost_INCLUDE_DIR} ) +link_directories( ${Boost_LIBRARY_DIRS} ) + +# Visual Studio needs some Windows-specific simplifications. +# Linux needs to reference the boost libs, even though they should be +# resolved via the Qpid libs. +if (MSVC) + add_definitions( /D "NOMINMAX" /D "WIN32_LEAN_AND_MEAN" /D "BOOST_ALL_DYN_LINK" ) + # On Windows, prevent the accidental inclusion of Boost headers from + # autolinking in the Boost libs. There should be no direct references to + # Boost in the examples, and references via qpidclient/qpidcommon are + # resolved in the Qpid libs. + add_definitions( /D "BOOST_ALL_NO_LIB" ) +else (MSVC) + set(_boost_libs_needed ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY}) +endif (MSVC) + +# There are numerous duplicate names within the examples. Since all target +# names must be unique, define a macro to prepend a prefix and manage the +# actual names. +# There can be an optional arguments at the end: libs to include +macro(add_example subdir example) + add_executable(${subdir}_${example} ${example}.cpp) + set_target_properties(${subdir}_${example} PROPERTIES OUTPUT_NAME ${example}) + if (${ARGC} GREATER 2) + target_link_libraries(${subdir}_${example} ${ARGN} qpidclient + ${_boost_libs_needed}) + else (${ARGC} GREATER 2) + target_link_libraries(${subdir}_${example} qpidclient + ${_boost_libs_needed}) + endif (${ARGC} GREATER 2) + # For installs, don't install the built example; that would be pointless. + # Install the things a user needs to build the example on-site. + install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp + DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/${subdir} + COMPONENT ${QPID_COMPONENT_EXAMPLES}) + if (MSVC) + install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}_${example}.vcproj + DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/${subdir} + COMPONENT ${QPID_COMPONENT_EXAMPLES}) + endif (MSVC) + +endmacro(add_example) + +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt + DESTINATION ${QPID_INSTALL_EXAMPLESDIR} + COMPONENT ${QPID_COMPONENT_EXAMPLES}) +if (MSVC) + install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples.sln + DESTINATION ${QPID_INSTALL_EXAMPLESDIR} + COMPONENT ${QPID_COMPONENT_EXAMPLES}) +endif (MSVC) + +add_subdirectory(qmf-console) +add_subdirectory(messaging) +add_subdirectory(old_api) |