aboutsummaryrefslogtreecommitdiff
path: root/ruby/CMakeLists.txt
blob: a200fe50d24404c137c4cd2b7473e79af0f97233 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
if(ENABLE_RUBY)
  include_directories(${CMAKE_CURRENT_BINARY_DIR})
  include_directories(${CMAKE_CURRENT_SOURCE_DIR})

  paludis_add_library(libpaludisruby
                        "${CMAKE_CURRENT_SOURCE_DIR}/action.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/choice.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/contents.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/dep_label.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/dep_spec.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/environment.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/filter.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/filtered_generator.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/generator.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/log.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/mask.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/metadata_key.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/name.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/package_id.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/paludis_ruby.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/qualified_package_name.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/repository.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/selection.cc"
                        "${CMAKE_CURRENT_SOURCE_DIR}/version_spec.cc"
                      NN_SOURCES
                        "${CMAKE_CURRENT_SOURCE_DIR}/nice_names.nn")
  target_include_directories(libpaludisruby SYSTEM
                             PRIVATE
                               ${RUBY_INCLUDE_DIRS})
  if(CXX_SUPPORTS_FDECLSPEC)
    target_compile_options(libpaludisruby PRIVATE -fdeclspec)
  endif()
  target_link_libraries(libpaludisruby
                        PRIVATE
                          libpaludis
                          libpaludisutil
                          ${RUBY_LIBRARY}
                          Threads::Threads)

  paludis_add_library(Paludis UNVERSIONED SHARED_LIBRARY
                        "${CMAKE_CURRENT_SOURCE_DIR}/paludis_ruby_so.cc")
  target_include_directories(Paludis SYSTEM
                             PRIVATE
                               ${RUBY_INCLUDE_DIRS})
  if(CXX_SUPPORTS_FDECLSPEC)
    target_compile_options(Paludis PRIVATE -fdeclspec)
  endif()
  target_link_libraries(Paludis
                        PRIVATE
                          libpaludisruby)
  set_target_properties(Paludis PROPERTIES
                        OUTPUT_NAME
                          Paludis
                        PREFIX
                          "")

  foreach(test
            contents
            filter
            filtered_generator
            log
            qualified_package_name
            selection
            version_spec)
    paludis_add_test(${test} RUBY)
  endforeach()

  foreach(test
            action
            choice
            dep_spec
            environment
            generator
            package_id
            paludis_ruby
            repository)
    paludis_add_test(${test} RUBY)
  endforeach()

  add_subdirectory(demos)

  install(TARGETS
            libpaludisruby
          DESTINATION
            "${CMAKE_INSTALL_FULL_LIBDIR}")
  install(TARGETS
            Paludis
          DESTINATION
            "${PALUDIS_RUBY_INSTALL_DIR}")
endif()