aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/CMakeLists.txt
blob: 5e15f2d43c0010384863e6c876cc8334674f8024 (plain)
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
39
40
41
42
43
44
45
46
47
# TODO(compnerd) populate PROJECT_VERSION_TWEAK and PALUDIS_GIT_HEAD
add_definitions(-DPALUDIS_PACKAGE="${PROJECT_NAME}"
                -DPALUDIS_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
                -DPALUDIS_VERSION_MINOR=${PROJECT_VERSION_MINOR}
                -DPALUDIS_VERSION_MICRO=${PROJECT_VERSION_PATCH}
                -DPALUDIS_VERSION_SUFFIX=""
                -DPALUDIS_GIT_HEAD="")

paludis_add_library(libpaludisexamples
                    STATIC_LIBRARY
                      "${CMAKE_CURRENT_SOURCE_DIR}/example_command_line.cc")
target_link_libraries(libpaludisexamples
                      INTERFACE
                        libpaludisargs)
add_dependencies(libpaludisexamples libpaludisargs_SE libpaludisutil_SE)

function(add_example example)
  add_executable(example_${example}
                   "${CMAKE_CURRENT_SOURCE_DIR}/example_${example}.cc")
  target_link_libraries(example_${example}
                        PRIVATE
                          libpaludisexamples
                          libpaludis
                          libpaludisutil)
endfunction()

foreach(example
          about
          action
          contents
          dep_label
          dep_spec
          dep_spec_flattener
          environment
          package_id
          mask
          metadata_key
          repository
          match_package
          selection
          version_operator
          version_spec
          name)
  add_example(${example})
endforeach()