# # 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(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 ( "${CMAKE_CURRENT_SOURCE_DIR}/build/include" ) include_directories ( "${CMAKE_CURRENT_SOURCE_DIR}/c/include" ) link_directories ( "${CMAKE_CURRENT_SOURCE_DIR}/build/lib" ) # # C examples # macro(c_example srcdirectory example) add_executable(${example} ${srcdirectory}/${example}.c) set_target_properties(${example} PROPERTIES OUTPUT_NAME ${example} ) set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/${CMAKE_BUILD_TYPE}) target_link_libraries(${example} optimized qpid-proton debug qpid-protond) endmacro() foreach(example broker-c direct receive send-abort send send-ssl) c_example(../c ${example}) endforeach() # # C++ examples # macro(cpp_example srcdirectory example) add_executable(${example} ${srcdirectory}/${example}.cpp) set_target_properties(${example} PROPERTIES OUTPUT_NAME ${example} ) set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/${CMAKE_BUILD_TYPE}) target_link_libraries(${example} optimized qpid-proton-cpp debug qpid-proton-cppd) set_source_files_properties(${srcdirectory}/${example}.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS}") endmacro() foreach(example broker client colour_send connection_options direct_recv direct_send encode_decode flow_control helloworld message_properties multithreaded_client multithreaded_client_flow_control queue_browser reconnect_client scheduled_send_03 scheduled_send selected_recv server server_direct service_bus simple_connect simple_recv simple_send ssl_client_cert ssl) cpp_example(../cpp ${example}) endforeach()