File: CMakeLists.txt

package info (click to toggle)
f3d 3.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,668 kB
  • sloc: cpp: 99,109; python: 811; sh: 342; xml: 238; java: 101; javascript: 95; makefile: 25
file content (45 lines) | stat: -rw-r--r-- 1,170 bytes parent folder | download | duplicates (2)
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
cmake_minimum_required(VERSION 3.19)

project(example-plugin)

include(GNUInstallDirs)

find_package(f3d REQUIRED COMPONENTS pluginsdk)

f3d_plugin_init()

f3d_plugin_declare_reader(
  NAME ExampleReader
  EXTENSIONS expl
  MIMETYPES application/vnd.expl
  VTK_READER vtkF3DExampleReader
  FORMAT_DESCRIPTION "Example reader"
)

f3d_plugin_build(
  NAME example
  VERSION 1.0
  DESCRIPTION "Example plugin"
  MIMETYPE_XML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/f3d-example-formats.xml"
  CONFIGURATION_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/configs/config.d" "${CMAKE_CURRENT_SOURCE_DIR}/configs/thumbnail.d"
  FREEDESKTOP
)

if(BUILD_TESTING)
  enable_testing()

  # Finding f3d is needed to test the plugin
  find_package(f3d REQUIRED COMPONENTS application)
  add_test(NAME TestPluginExample
          COMMAND "$<TARGET_FILE:f3d::f3d>"
                  "--no-config"
                  "--no-render"
                  "--verbose"
                  "--load-plugins=$<TARGET_FILE:f3d-plugin-example>"
                  "${CMAKE_CURRENT_SOURCE_DIR}/data.expl"
  )

  set_tests_properties(TestPluginExample PROPERTIES
    PASS_REGULAR_EXPRESSION "Number of points: 3"
  )
endif()