File: CMakeLists.txt

package info (click to toggle)
opensurgsim 0.7.0-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,744 kB
  • sloc: cpp: 135,363; ansic: 4,206; python: 3,934; makefile: 38
file content (118 lines) | stat: -rw-r--r-- 3,343 bytes parent folder | download | duplicates (3)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# This file is a part of the OpenSurgSim project.
# Copyright 2013, SimQuest Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include_directories("${CMAKE_CURRENT_SOURCE_DIR}")

if(WDK_FOUND)
	if(WDK_CAN_BUILD_DIRECTLY)
		#message(STATUS "WDK does not need additional include paths; see the try_compile in FindWDK.cmake")
	else(WDK_CAN_BUILD_DIRECTLY)
		#message(STATUS "WDK was found, and needs the include directory '${WDK_INCLUDE_DIR}'.")
		include_directories(
				# This is a hack needed to get the Visual Studio includes into the
				# include path ahead of the WDK ones, which is needed for the WDK
				# 7.1.0 not to interfere with includes provided by Visual Studio.
				# CMake will prefix this entry by the current path, but Visual
				# Studio will split the path at the semicolon; the net effect is to
				# add $(IncludePath) to the Visual Studio include directories.
				# In cmake 2.8.11+, this hack generates a Policy CMP0021 warning due to relative path.
				".;$(IncludePath)"
				# Now it's safe to add ${WDK_INCLUDE_DIR}.
				"${WDK_INCLUDE_DIR}"
				)
	endif(WDK_CAN_BUILD_DIRECTLY)
endif(WDK_FOUND)

set(MULTIAXIS_DEVICE_SOURCES
	MultiAxisDevice.cpp
	RawMultiAxisDevice.cpp
	RawMultiAxisScaffold.cpp
	RawMultiAxisThread.cpp
	SystemInputDeviceHandle.cpp
)

set(MULTIAXIS_DEVICE_HEADERS
	CreateInputDeviceHandle.h
	GetSystemError.h
	MultiAxisDevice.h
	RawMultiAxisDevice.h
	RawMultiAxisScaffold.h
	RawMultiAxisThread.h
	SystemInputDeviceHandle.h
)

set(DEVICE_HEADERS ${DEVICE_HEADERS}
	MultiAxis/MultiAxisDevice.h #NOLINT
	MultiAxis/RawMultiAxisDevice.h #NOLINT
	PARENT_SCOPE)

set(MULTIAXIS_DEVICE_LINUX_SOURCES
	linux/CreateInputDeviceHandle.cpp
	linux/FileDescriptor.cpp
	linux/GetSystemError.cpp
	linux/InputDeviceHandle.cpp
)

set(MULTIAXIS_DEVICE_LINUX_HEADERS
	BitSetBuffer.h
	linux/FileDescriptor.h
	linux/InputDeviceHandle.h
)

set(MULTIAXIS_DEVICE_WDK_HID_SOURCES
	win32/CreateInputDeviceHandle.cpp
	win32/FileHandle.cpp
	win32/GetSystemError.cpp
	win32/WdkHidDeviceHandle.cpp
)

set(MULTIAXIS_DEVICE_WDK_HID_HEADERS
	win32/FileHandle.h
	win32/WdkHidDeviceHandle.h
)

list(APPEND MULTIAXIS_DEVICE_SOURCES ${MULTIAXIS_DEVICE_LINUX_SOURCES})
list(APPEND MULTIAXIS_DEVICE_HEADERS ${MULTIAXIS_DEVICE_LINUX_HEADERS})

# TODO(advornik): the installation should NOT copy all the headers...
surgsim_add_library(
	MultiAxisDevice
	"${MULTIAXIS_DEVICE_SOURCES}"
	"${MULTIAXIS_DEVICE_HEADERS}"
)

set(LIBS  
	SurgSimDeviceFilters
	SurgSimInput 
	SurgSimFramework 
)

if(WDK_FOUND)
	list(APPEND LIBS ${WDK_LIBRARIES})
endif()

target_link_libraries(MultiAxisDevice ${LIBS}
)

if(BUILD_TESTING)
	add_subdirectory(UnitTests)

	if(GLUT_FOUND)
		add_subdirectory(VisualTest)
	endif(GLUT_FOUND)
endif()

# Put MultiAxisDevice into folder "Devices"
set_target_properties(MultiAxisDevice PROPERTIES FOLDER "Devices")