This repository has been archived by the owner on Aug 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
83 lines (65 loc) · 2.75 KB
/
CMakeLists.txt
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
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
cmake_minimum_required (VERSION 2.6)
project (nvidia-query-resource-opengl)
include_directories(include)
# The query tool executable
add_executable (nvqrgl-bin
tool/main.c
)
set_target_properties (nvqrgl-bin PROPERTIES
OUTPUT_NAME nvidia-query-resource-opengl
)
# Static library for custom clients
add_library (nvqrgl-lib STATIC
common/nvidia-query-resource-opengl-ipc-util.c
tool/nvidia-query-resource-opengl.c
tool/nvidia-query-resource-opengl-data.c
)
set_target_properties (nvqrgl-lib PROPERTIES
OUTPUT_NAME nvidia-query-resource-opengl
)
# Socket functionality is in a separate libsocket library on Solaris
include (CheckLibraryExists)
CHECK_LIBRARY_EXISTS (socket bind "" SOCKET_LIBRARY)
if (SOCKET_LIBRARY)
set(LINK_SOCKET socket)
endif ()
target_link_libraries (nvqrgl-bin nvqrgl-lib ${LINK_SOCKET})
# Build the preload library on Unix
if (NOT WIN32)
add_library (nvidia-query-resource-opengl-preload SHARED
common/nvidia-query-resource-opengl-ipc-util.c
preload/nvidia-query-resource-opengl-preload.c
)
# Find GL and X11 include / link paths
# XXX find_path() doesn't seem to work on Solaris, but it's okay,
# since the GL and X11 headers tend to be in /usr/include there.
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
find_path (GL_INCLUDE_DIR GL/gl.h)
find_path (X11_INCLUDE_DIR X11/Xlib.h)
include_directories("${GL_INCLUDE_DIR}" "${X11_INCLUDE_DIR}")
endif ()
find_library (LIBGL_PATH GL)
find_library (LIBX11_PATH X11)
target_link_libraries (nvidia-query-resource-opengl-preload
${LIBGL_PATH} ${LIBX11_PATH} pthread ${LINK_SOCKET}
)
endif ()