1*35238bceSAndroid Build Coastguard Worker#------------------------------------------------------------------------- 2*35238bceSAndroid Build Coastguard Worker# drawElements CMake utilities 3*35238bceSAndroid Build Coastguard Worker# ---------------------------- 4*35238bceSAndroid Build Coastguard Worker# 5*35238bceSAndroid Build Coastguard Worker# Copyright 2016 The Android Open Source Project 6*35238bceSAndroid Build Coastguard Worker# Copyright (c) 2016 The Khronos Group Inc. 7*35238bceSAndroid Build Coastguard Worker# 8*35238bceSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 9*35238bceSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 10*35238bceSAndroid Build Coastguard Worker# You may obtain a copy of the License at 11*35238bceSAndroid Build Coastguard Worker# 12*35238bceSAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 13*35238bceSAndroid Build Coastguard Worker# 14*35238bceSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 15*35238bceSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 16*35238bceSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17*35238bceSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 18*35238bceSAndroid Build Coastguard Worker# limitations under the License. 19*35238bceSAndroid Build Coastguard Worker# 20*35238bceSAndroid Build Coastguard Worker#------------------------------------------------------------------------- 21*35238bceSAndroid Build Coastguard Worker 22*35238bceSAndroid Build Coastguard Workermessage("*** Default target") 23*35238bceSAndroid Build Coastguard Worker 24*35238bceSAndroid Build Coastguard Workerset(DEQP_TARGET_NAME "Default") 25*35238bceSAndroid Build Coastguard Worker 26*35238bceSAndroid Build Coastguard Workerif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") 27*35238bceSAndroid Build Coastguard Workerlink_directories(/usr/local/lib) 28*35238bceSAndroid Build Coastguard Workerendif () 29*35238bceSAndroid Build Coastguard Worker 30*35238bceSAndroid Build Coastguard Worker# For static linking 31*35238bceSAndroid Build Coastguard Workerfind_library(GLES2_LIBRARY NAMES libGLESv2 GLESv2) 32*35238bceSAndroid Build Coastguard Workerfind_library(EGL_LIBRARY NAMES libEGL EGL) 33*35238bceSAndroid Build Coastguard Worker 34*35238bceSAndroid Build Coastguard Workerfind_path(GLES2_INCLUDE_PATH GLES2/gl2.h) 35*35238bceSAndroid Build Coastguard Workerfind_path(GLES3_INCLUDE_PATH GLES3/gl3.h) 36*35238bceSAndroid Build Coastguard Workerfind_path(EGL_INCLUDE_PATH EGL/egl.h) 37*35238bceSAndroid Build Coastguard Worker 38*35238bceSAndroid Build Coastguard Workerif (GLES2_LIBRARY AND GLES2_INCLUDE_PATH) 39*35238bceSAndroid Build Coastguard Worker if (GLES_ALLOW_DIRECT_LINK) 40*35238bceSAndroid Build Coastguard Worker set(DEQP_GLES2_LIBRARIES ${GLES2_LIBRARY}) 41*35238bceSAndroid Build Coastguard Worker endif () 42*35238bceSAndroid Build Coastguard Worker include_directories(${GLES2_INCLUDE_PATH}) 43*35238bceSAndroid Build Coastguard Workerendif () 44*35238bceSAndroid Build Coastguard Worker 45*35238bceSAndroid Build Coastguard Workerif (GLES2_LIBRARY AND GLES3_INCLUDE_PATH AND GLES_ALLOW_DIRECT_LINK) 46*35238bceSAndroid Build Coastguard Worker # Assume that GLESv2 provides ES3 symbols if GLES3/gl3.h was found 47*35238bceSAndroid Build Coastguard Worker set(DEQP_GLES3_LIBRARIES ${GLES2_LIBRARY}) 48*35238bceSAndroid Build Coastguard Workerendif () 49*35238bceSAndroid Build Coastguard Worker 50*35238bceSAndroid Build Coastguard Workerif (EGL_LIBRARY AND EGL_INCLUDE_PATH) 51*35238bceSAndroid Build Coastguard Worker if (GLES_ALLOW_DIRECT_LINK) 52*35238bceSAndroid Build Coastguard Worker set(DEQP_EGL_LIBRARIES ${EGL_LIBRARY}) 53*35238bceSAndroid Build Coastguard Worker endif () 54*35238bceSAndroid Build Coastguard Worker include_directories(${EGL_INCLUDE_PATH}) 55*35238bceSAndroid Build Coastguard Workerendif () 56*35238bceSAndroid Build Coastguard Worker 57*35238bceSAndroid Build Coastguard Worker# X11 / GLX? 58*35238bceSAndroid Build Coastguard Workerif (DE_OS_IS_UNIX) 59*35238bceSAndroid Build Coastguard Worker find_package(X11) 60*35238bceSAndroid Build Coastguard Worker if (X11_FOUND) 61*35238bceSAndroid Build Coastguard Worker set(DEQP_USE_X11 ON) 62*35238bceSAndroid Build Coastguard Worker set(DEQP_SUPPORT_GLX ON) 63*35238bceSAndroid Build Coastguard Worker endif () 64*35238bceSAndroid Build Coastguard Worker 65*35238bceSAndroid Build Coastguard Worker set(DEQP_PLATFORM_LIBRARIES ${X11_LIBRARIES}) 66*35238bceSAndroid Build Coastguard Worker include_directories(${X11_INCLUDE_DIR}) 67*35238bceSAndroid Build Coastguard Worker 68*35238bceSAndroid Build Coastguard Worker set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/targets/default") 69*35238bceSAndroid Build Coastguard Worker 70*35238bceSAndroid Build Coastguard Worker # Use XCB target if available 71*35238bceSAndroid Build Coastguard Worker set(DEQP_USE_XCB OFF) 72*35238bceSAndroid Build Coastguard Worker find_package(XCB) 73*35238bceSAndroid Build Coastguard Worker if (XCB_FOUND) 74*35238bceSAndroid Build Coastguard Worker set(DEQP_USE_XCB ON) 75*35238bceSAndroid Build Coastguard Worker set(DEQP_PLATFORM_LIBRARIES ${XCB_LIBRARIES}) 76*35238bceSAndroid Build Coastguard Worker include_directories(${XCB_INCLUDE_DIR}) 77*35238bceSAndroid Build Coastguard Worker endif () 78*35238bceSAndroid Build Coastguard Worker find_package(Wayland) 79*35238bceSAndroid Build Coastguard Worker if (WAYLAND_FOUND) 80*35238bceSAndroid Build Coastguard Worker set(DEQP_USE_WAYLAND ON) 81*35238bceSAndroid Build Coastguard Worker set(DEQP_PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES}) 82*35238bceSAndroid Build Coastguard Worker include_directories(${WAYLAND_INCLUDE_DIR}) 83*35238bceSAndroid Build Coastguard Worker endif () 84*35238bceSAndroid Build Coastguard Workerendif () 85*35238bceSAndroid Build Coastguard Worker 86*35238bceSAndroid Build Coastguard Worker# Win32? 87*35238bceSAndroid Build Coastguard Workerif (DE_OS_IS_WIN32) 88*35238bceSAndroid Build Coastguard Worker set(DEQP_SUPPORT_WGL ON) 89*35238bceSAndroid Build Coastguard Workerendif () 90*35238bceSAndroid Build Coastguard Worker 91*35238bceSAndroid Build Coastguard Worker# MacOS? 92*35238bceSAndroid Build Coastguard Workerif (DE_OS_IS_OSX) 93*35238bceSAndroid Build Coastguard Worker find_package(OpenGL REQUIRED) 94*35238bceSAndroid Build Coastguard Worker find_library(COCOA_LIBRARY Cocoa) 95*35238bceSAndroid Build Coastguard Worker find_library(QUARTZCORE_LIBRARY QuartzCore) 96*35238bceSAndroid Build Coastguard Worker set(DEQP_PLATFORM_LIBRARIES ${OPENGL_LIBRARIES} ${COCOA_LIBRARY} ${QUARTZCORE_LIBRARY}) 97*35238bceSAndroid Build Coastguard Worker include_directories(${OPENGL_INCLUDE_DIRS}) 98*35238bceSAndroid Build Coastguard Workerendif() 99