File: CMakeLists.txt

package info (click to toggle)
libzeep 7.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,372 kB
  • sloc: cpp: 17,430; javascript: 180; makefile: 12; sh: 11
file content (38 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#         Copyright Maarten L. Hekkelman, 2022-2026
#  Distributed under the Boost Software License, Version 1.0.
#     (See accompanying file LICENSE_1_0.txt or copy at
#           http://www.boost.org/LICENSE_1_0.txt)

cmake_minimum_required(VERSION 3.16)

project(libzeep-examples LANGUAGES CXX)

set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Only try to find package if we're not included from the main libzeep CMakeLists.txt
if(PROJECT_IS_TOP_LEVEL)
    find_package(zeep REQUIRED)
endif()

if(UNIX)
    find_file(HAVE_UNISTD_H "unistd.h")

    if(HAVE_UNISTD_H)
        set(HTTP_HAS_UNIX_DAEMON 1)
    endif()
endif()

list(APPEND examples http-server-0 http-server-1 http-server-2 http-server-3
    security-sample rest-sample rest-sample-2 # soap-sample
)

if(HTTP_HAS_UNIX_DAEMON)
    list(APPEND examples daemon-sample)
endif()

foreach(EXAMPLE IN LISTS examples)
    add_executable(${EXAMPLE} ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}.cpp)
    target_link_libraries(${EXAMPLE} zeep::zeep)
endforeach()