forked from Eyescale/CMake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindMAGELLAN.cmake
42 lines (35 loc) · 1.18 KB
/
FindMAGELLAN.cmake
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
# Copyright (c) 2011-2013 Stefan Eilemann <eile@eyescale.ch>
include(FindPackageHandleStandardArgs)
set(MAGELLAN_API "spnav")
if(APPLE)
foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
if(ARCH STREQUAL "ppc" OR ARCH STREQUAL "i386")
set(MAGELLAN_API "Carbon")
endif()
endforeach()
endif()
if(MSVC)
set(MAGELLAN_API "Windows")
endif()
if(MAGELLAN_FIND_COMPONENTS)
set(MAGELLAN_API ${MAGELLAN_FIND_COMPONENTS})
endif()
if(MAGELLAN_API STREQUAL "Windows")
set(MAGELLAN_FOUND 1) # always on
return()
endif()
if(MAGELLAN_API STREQUAL "Carbon")
find_path(MAGELLAN_INCLUDE_DIR 3DconnexionClient/ConnexionClientAPI.h)
find_library(MAGELLAN_LIBRARY 3DconnexionClient)
# WAR cmake bug:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -F/Library/Frameworks")
elseif(MAGELLAN_API STREQUAL "spnav")
find_path(MAGELLAN_INCLUDE_DIR spnav.h PATHS /usr/include /usr/local/include)
find_library(MAGELLAN_LIBRARY spnav PATHS /usr/lib /usr/local/lib)
endif()
find_package_handle_standard_args(MAGELLAN DEFAULT_MSG MAGELLAN_INCLUDE_DIR
MAGELLAN_LIBRARY)
if(MAGELLAN_FOUND AND NOT MAGELLAN_FIND_QUIETLY)
message(STATUS
"Found SpaceMouse API in ${MAGELLAN_INCLUDE_DIR};${MAGELLAN_LIBRARY}")
endif()