| 1 |
# |
| 2 |
# Licensed to the Apache Software Foundation (ASF) under one |
| 3 |
# or more contributor license agreements. See the NOTICE file |
| 4 |
# distributed with this work for additional information |
| 5 |
# regarding copyright ownership. The ASF licenses this file |
| 6 |
# to you under the Apache License, Version 2.0 (the |
| 7 |
# "License"); you may not use this file except in compliance |
| 8 |
# with the License. You may obtain a copy of the License at |
| 9 |
# |
| 10 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
# |
| 12 |
# Unless required by applicable law or agreed to in writing, |
| 13 |
# software distributed under the License is distributed on an |
| 14 |
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 |
# KIND, either express or implied. See the License for the |
| 16 |
# specific language governing permissions and limitations |
| 17 |
# under the License. |
| 18 |
# |
| •19 |
cmake_minimum_required (VERSION 3.16) |
| 20 |
|
| 21 |
project(ProtonCppExamples C CXX) |
| 22 |
|
| 23 |
find_package(ProtonCpp REQUIRED) |
| 24 |
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
| 25 |
find_package(Threads REQUIRED) |
| 26 |
|
| •27 |
set(CMAKE_CXX_STANDARD 11) |
| 28 |
set(CMAKE_CXX_EXTENSIONS OFF) |
| 29 |
|
| 30 |
# Single-threaded examples |
| 31 |
foreach(example |
| 32 |
broker |
| 33 |
helloworld |
| 34 |
simple_connect |
| 35 |
simple_recv |
| 36 |
simple_send |
| 37 |
reconnect_client |
| 38 |
message_properties |
| 39 |
scheduled_send_03 |
| 40 |
direct_recv |
| 41 |
direct_send |
| 42 |
client |
| 43 |
server |
| 44 |
server_direct |
| 45 |
connection_options |
| 46 |
queue_browser |
| 47 |
colour_send |
| 48 |
selected_recv |
| 49 |
flow_control |
| 50 |
ssl |
| 51 |
ssl_client_cert |
| 52 |
encode_decode |
| 53 |
scheduled_send |
| 54 |
service_bus) |
| 55 |
add_executable(${example} ${example}.cpp) |
| 56 |
target_link_libraries(${example} Proton::cpp) |
| 57 |
endforeach() |
| 58 |
|
| 59 |
# Examples that use threads directly |
| 60 |
foreach(example |
| 61 |
multithreaded_client |
| 62 |
multithreaded_client_flow_control) |
| 63 |
add_executable(${example} ${example}.cpp) |
| 64 |
target_link_libraries(${example} Proton::cpp Threads::Threads) |
| 65 |
endforeach() |