1 #-------------------------------------------------------------------------
2 # drawElements CMake utilities
3 # ----------------------------
5 # Copyright 2016 The Android Open Source Project
6 # Copyright (c) 2016 The Khronos Group Inc.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
20 #-------------------------------------------------------------------------
22 message("*** Default target")
24 set(DEQP_TARGET_NAME "Default")
26 if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
27 link_directories(/usr/local/lib)
31 find_library(GLES2_LIBRARY NAMES libGLESv2 GLESv2)
32 find_library(EGL_LIBRARY NAMES libEGL EGL)
34 find_path(GLES2_INCLUDE_PATH GLES2/gl2.h)
35 find_path(GLES3_INCLUDE_PATH GLES3/gl3.h)
36 find_path(EGL_INCLUDE_PATH EGL/egl.h)
38 if (GLES2_LIBRARY AND GLES2_INCLUDE_PATH)
39 set(DEQP_GLES2_LIBRARIES ${GLES2_LIBRARY})
40 include_directories(${GLES2_INCLUDE_PATH})
43 if (GLES2_LIBRARY AND GLES3_INCLUDE_PATH)
44 # Assume that GLESv2 provides ES3 symbols if GLES3/gl3.h was found
45 set(DEQP_GLES3_LIBRARIES ${GLES2_LIBRARY})
48 if (EGL_LIBRARY AND EGL_INCLUDE_PATH)
49 set(DEQP_EGL_LIBRARIES ${EGL_LIBRARY})
50 include_directories(${EGL_INCLUDE_PATH})
58 set(DEQP_SUPPORT_GLX ON)
61 set(DEQP_PLATFORM_LIBRARIES ${X11_LIBRARIES})
62 include_directories(${X11_INCLUDE_DIR})
64 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/targets/default")
66 # Use XCB target if available
71 set(DEQP_PLATFORM_LIBRARIES ${XCB_LIBRARIES})
72 include_directories(${XCB_INCLUDE_DIR})
76 set(DEQP_USE_WAYLAND ON)
77 set(DEQP_PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES})
78 include_directories(${WAYLAND_INCLUDE_DIR})
84 set(DEQP_SUPPORT_WGL ON)
89 find_package(OpenGL REQUIRED)
90 find_library(COCOA_LIBRARY Cocoa)
91 find_library(QUARTZCORE_LIBRARY QuartzCore)
92 set(DEQP_PLATFORM_LIBRARIES ${OPENGL_LIBRARIES} ${COCOA_LIBRARY} ${QUARTZCORE_LIBRARY})
93 include_directories(${OPENGL_INCLUDE_DIRS})