File: FindzSpaceCompat.cmake

package info (click to toggle)
paraview 5.11.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 497,236 kB
  • sloc: cpp: 3,171,290; ansic: 1,315,072; python: 134,290; xml: 103,324; sql: 65,887; sh: 5,286; javascript: 4,901; yacc: 4,383; java: 3,977; perl: 2,363; lex: 1,909; f90: 1,255; objc: 143; makefile: 119; tcl: 59; pascal: 50; fortran: 29
file content (99 lines) | stat: -rw-r--r-- 2,539 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
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
93
94
95
96
97
98
99
#[=======================================================================[
FindzSpace
--------

Find the zSpace Core Compatibility SDK. This is the newest version of the zSpace SDK,
intended to work with all zSpace hardware, including the newest (like the Inspire).

IMPORTED Targets
^^^^^^^^^^^^^^^^

This module defines 3 targets if zSpace has been found:

``zSpaceHeaders``
  zSpace header files
``zSpaceImpl``
  zSpace library (dll). 
  We don't use any shared library at compile time.

Result Variables
^^^^^^^^^^^^^^^^

This module will set the following variables in your project:

``zSpaceCompat_FOUND``
  True if zSpace is found.
``zSpace_INCLUDE_DIRS``
  Path to include directory for zSpace headers.
``zSpace_LIBRARIES``
  Path to zSpace library (.dll).

Cache variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``zSpace_INCLUDE_DIR``
  Path to include directory for zSpace headers.
``zSpace_LIBRARY``
  Path to zSpace library (.dll).

Hints
^^^^^

Set ``zSpace_DIR`` or ``zSpace_ROOT`` in the environment to specify the
zSpace installation prefix.
example : set zSpace_DIR=C:/zSpace/zSpaceSdks/CoreCompatibility_1.0.0.12
#]=======================================================================]

# Find zSpace headers folder
find_path(zSpace_INCLUDE_DIR 
  NAMES 
    zSpaceCoreCompatibility.h
  HINTS
    ${zSpace_ROOT}
    ENV zSpace_DIR
    ENV zSpace_ROOT
  PATH_SUFFIXES
    zSpaceSdks
    include
    Inc
  DOC "Path to the zSpace Core Compatibility SDK include directory"
)
mark_as_advanced(zSpace_INCLUDE_DIR)

# Find zSpace library
find_file(zSpace_LIBRARY
  NAMES
    zSpaceCoreCompatibility64.dll
    zSpaceCoreCompatibility.dll
  HINTS
    ${zSpace_ROOT}
    ENV zSpace_DIR
    ENV zSpace_ROOT
  PATH_SUFFIXES
    zSpaceSdks
    Bin
  DOC "Path to the zSpace Core Compatibility SDK library"
)
mark_as_advanced(zSpace_LIBRARY)

# Handle some find_package arguments like REQUIRED
# and set the zSpace_FOUND variable
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(zSpaceCompat
    REQUIRED_VARS zSpace_LIBRARY zSpace_INCLUDE_DIR)

if (zSpaceCompat_FOUND)
  if (NOT TARGET zSpaceHeaders)
    # Interface library (headers only)
    add_library(zSpaceHeaders INTERFACE IMPORTED)
    target_include_directories(zSpaceHeaders 
      INTERFACE "${zSpace_INCLUDE_DIR}")
      
    # For later purpose (install, etc.)
    add_library(zSpaceImpl MODULE IMPORTED)
    set_target_properties(zSpaceImpl PROPERTIES
      IMPORTED_LOCATION "${zSpace_LIBRARY}")
  endif ()
endif ()