File: FindVirtuoseAPI.cmake

package info (click to toggle)
freespace2 24.0.2%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 43,188 kB
  • sloc: cpp: 583,107; ansic: 21,729; python: 1,174; sh: 464; makefile: 248; xml: 181
file content (93 lines) | stat: -rw-r--r-- 2,167 bytes parent folder | download | duplicates (8)
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
# - try to find Haption VirtuoseAPI library and include files
#
#  VIRTUOSEAPI_INCLUDE_DIRS, where to find headers
#  VIRTUOSEAPI_LIBRARIES, the libraries to link against
#  VIRTUOSEAPI_FOUND, If false, do not try to use this library
#  VIRTUOSEAPI_RUNTIME_LIBRARY_DIRS, path to DLL/SO for runtime use.
#  VIRTUOSEAPI_RUNTIME_LIBRARIES, runtime libraries you might want to install

set(VIRTUOSEAPI_ROOT_DIR
	"${VIRTUOSEAPI_ROOT_DIR}"
	CACHE
	PATH
	"Path to search for VirtuoseAPI")

set(_dirs)
if(WIN32)
	include(ProgramFilesGlob)
	program_files_fallback_glob(_dirs "/VirtuoseAPI_v*/")
endif()

find_path(VIRTUOSEAPI_INCLUDE_DIR
	virtuoseAPI.h
	VirtuoseAPI.h
	PATHS
	${_dirs}
	HINTS
	"${VIRTUOSEAPI_ROOT_DIR}")

set(_suffixes)
if(WIN32)
	set(_lib_name virtuoseDLL)
	set(_runtime_name virtuoseAPI.dll)

	if(CMAKE_SIZEOF_VOID_P EQUAL 8)
		set(_suffixes win64)
	else()
		set(_suffixes win32)
	endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
	set(_lib_name virtuose)
	set(_runtime_name virtuoseAPI.so)

	if(CMAKE_SIZEOF_VOID_P EQUAL 8)
		set(_suffixes linux-64b)
	else()
		set(_suffixes linux linux-2.6)
	endif()
endif()

if(_suffixes)
	find_library(VIRTUOSEAPI_LIBRARY
		NAMES
		${_lib_name}
		PATHS
		${_dirs}
		HINTS
		"${VIRTUOSEAPI_ROOT_DIR}"
		PATH_SUFFIXES
		${_suffixes})
	find_file(VIRTUOSEAPI_RUNTIME_LIBRARY
		NAMES
		${_runtime_name}
		PATHS
		${_dirs}
		HINTS
		"${VIRTUOSEAPI_ROOT_DIR}"
		PATH_SUFFIXES
		${_suffixes})
endif()

# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VirtuoseAPI
	DEFAULT_MSG
	VIRTUOSEAPI_LIBRARY
	VIRTUOSEAPI_RUNTIME_LIBRARY
	VIRTUOSEAPI_INCLUDE_DIR)

if(VIRTUOSEAPI_FOUND)
	set(VIRTUOSEAPI_LIBRARIES "${VIRTUOSEAPI_LIBRARY}")
	set(VIRTUOSEAPI_RUNTIME_LIBRARIES "${VIRTUOSEAPI_RUNTIME_LIBRARY}")
	set(VIRTUOSEAPI_INCLUDE_DIRS "${VIRTUOSEAPI_INCLUDE_DIR}")
	get_filename_component(VIRTUOSEAPI_RUNTIME_LIBRARY_DIRS
		"${VIRTUOSEAPI_RUNTIME_LIBRARY}"
		PATH)

	mark_as_advanced(VIRTUOSEAPI_ROOT_DIR)
endif()

mark_as_advanced(VIRTUOSEAPI_LIBRARY
	VIRTUOSEAPI_RUNTIME_LIBRARY
	VIRTUOSEAPI_INCLUDE_DIR)