# Include target-specific definitions
include(targets/${DEQP_TARGET}/${DEQP_TARGET}.cmake)
+# zlib
+find_path(ZLIB_INCLUDE_PATH zlib.h)
+find_library(ZLIB_LIBRARY z)
+
+if (NOT ZLIB_INCLUDE_PATH OR NOT ZLIB_LIBRARY)
+ message(STATUS "System version of zlib not found, using external/zlib")
+ add_subdirectory(external/zlib)
+ # \note ZLIB_LIBRARY and ZLIB_INCLUDE_PATH are promoted from external/zlib/CMakeLists.txt
+endif ()
+
+include_directories(${ZLIB_INCLUDE_PATH})
+
+# libpng
+find_path(PNG_INCLUDE_PATH libpng.h)
+find_library(PNG_LIBRARY png)
+
+if (NOT PNG_INCLUDE_PATH OR NOT PNG_LIBRARY)
+ message(STATUS "System version of libpng not found, using external/libpng")
+ add_subdirectory(external/libpng)
+ # \note PNG_LIBRARY and PNG_INCLUDE_PATH are promoted from external/libpng/CMakeLists.txt
+endif ()
+
+include_directories(${PNG_INCLUDE_PATH})
+
# \todo [2013-04-14 pyry] Remove once we've got dynamic loading of GL libraries figured out
if (DEQP_RUNTIME_LINK)
include_directories(wrappers/dynlib/inc)
project.properties
proguard-project.txt
debug
+build
def getNativeBuildDir (nativeLib, buildType):
deqpDir = os.path.normpath(os.path.join(common.ANDROID_DIR, ".."))
- return os.path.normpath(os.path.join(deqpDir, "..", "deqp-build-android-%d-%s-%s" % (nativeLib.apiVersion, nativeLib.abiVersion, buildType.lower())))
+ return os.path.normpath(os.path.join(deqpDir, "android", "build", "%s-%d-%s" % (buildType.lower(), nativeLib.apiVersion, nativeLib.abiVersion)))
def buildNative (nativeLib, buildType):
deqpDir = os.path.normpath(os.path.join(common.ANDROID_DIR, ".."))
--- /dev/null
+# cmake file for libpng
+
+if (NOT DE_DEFS)
+ message(FATAL_ERROR "Include Defs.cmake")
+endif ()
+
+set(PNG_SRC_PATH "../../../libpng" CACHE STRING "Path to libpng source tree")
+
+set(PNG_SRCS
+ ${PNG_SRC_PATH}/png.h
+ ${PNG_SRC_PATH}/pngconf.h
+ ${PNG_SRC_PATH}/png.c
+ ${PNG_SRC_PATH}/pngset.c
+ ${PNG_SRC_PATH}/pngget.c
+ ${PNG_SRC_PATH}/pngrutil.c
+ ${PNG_SRC_PATH}/pngtrans.c
+ ${PNG_SRC_PATH}/pngwutil.c
+ ${PNG_SRC_PATH}/pngread.c
+ ${PNG_SRC_PATH}/pngrio.c
+ ${PNG_SRC_PATH}/pngwio.c
+ ${PNG_SRC_PATH}/pngwrite.c
+ ${PNG_SRC_PATH}/pngrtran.c
+ ${PNG_SRC_PATH}/pngwtran.c
+ ${PNG_SRC_PATH}/pngmem.c
+ ${PNG_SRC_PATH}/pngerror.c
+ ${PNG_SRC_PATH}/pngpread.c
+ )
+
+if (DE_DEBUG EQUAL 1)
+ add_definitions(-DPNG_DEBUG)
+endif ()
+
+if (DE_OS_IS_UNIX)
+ # for snprintf()
+ add_definitions(-D_XOPEN_SOURCE=600)
+endif ()
+
+set(CMAKE_C_FLAGS ${DE_3RD_PARTY_C_FLAGS})
+
+add_library(png STATIC ${PNG_SRCS})
+target_link_libraries(png ${ZLIB_LIBRARY})
+
+if (IS_ABSOLUTE ${PNG_SRC_PATH})
+ set(PNG_INCLUDE_PATH ${PNG_SRC_PATH} PARENT_SCOPE)
+else ()
+ set(PNG_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${PNG_SRC_PATH}" PARENT_SCOPE)
+endif ()
+
+set(PNG_LIBRARY png PARENT_SCOPE)
--- /dev/null
+# cmake file for zlib
+
+if (NOT DE_DEFS)
+ message(FATAL_ERROR "Include Defs.cmake")
+endif ()
+
+set(ZLIB_SRC_PATH "../../../zlib/src" CACHE STRING "Path to zlib source tree")
+
+set(ZLIB_SRCS
+ ${ZLIB_SRC_PATH}/adler32.c
+ ${ZLIB_SRC_PATH}/compress.c
+ ${ZLIB_SRC_PATH}/crc32.c
+ ${ZLIB_SRC_PATH}/crc32.h
+ ${ZLIB_SRC_PATH}/deflate.c
+ ${ZLIB_SRC_PATH}/deflate.h
+ ${ZLIB_SRC_PATH}/gzclose.c
+ ${ZLIB_SRC_PATH}/gzguts.h
+ ${ZLIB_SRC_PATH}/gzlib.c
+ ${ZLIB_SRC_PATH}/gzread.c
+ ${ZLIB_SRC_PATH}/gzwrite.c
+ ${ZLIB_SRC_PATH}/infback.c
+ ${ZLIB_SRC_PATH}/inffast.c
+ ${ZLIB_SRC_PATH}/inffast.h
+ ${ZLIB_SRC_PATH}/inffixed.h
+ ${ZLIB_SRC_PATH}/inflate.c
+ ${ZLIB_SRC_PATH}/inflate.h
+ ${ZLIB_SRC_PATH}/inftrees.c
+ ${ZLIB_SRC_PATH}/inftrees.h
+ ${ZLIB_SRC_PATH}/trees.c
+ ${ZLIB_SRC_PATH}/trees.h
+ ${ZLIB_SRC_PATH}/uncompr.c
+ ${ZLIB_SRC_PATH}/zconf.h
+ ${ZLIB_SRC_PATH}/zlib.h
+ ${ZLIB_SRC_PATH}/zutil.c
+ ${ZLIB_SRC_PATH}/zutil.h
+ )
+
+if (DE_COMPILER_IS_MSC)
+ # 4127: conditional expression is constant
+ # 4131: 'x': uses old style declarator
+ # 4242, 4244: conversion from 'x' to 'y', possible loss of data
+ # 4996: deprecated POSIX name
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4127 /wd4131 /wd4242 /wd4244 /wd4996")
+endif ()
+
+if (DE_OS_IS_UNIX)
+ add_definitions(-D_XOPEN_SOURCE=600)
+endif ()
+
+add_library(z STATIC ${ZLIB_SRCS})
+
+if (IS_ABSOLUTE ${ZLIB_SRC_PATH})
+ set(ZLIB_INCLUDE_PATH ${ZLIB_SRC_PATH} PARENT_SCOPE)
+else ()
+ set(ZLIB_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${ZLIB_SRC_PATH}" PARENT_SCOPE)
+endif ()
+
+set(ZLIB_LIBRARY z PARENT_SCOPE)
decpp
qphelper
dethread
+ ${PNG_LIBRARY}
)
add_library(tcutil STATIC ${TCUTIL_SRCS})
+++ /dev/null
-#-------------------------------------------------------------------------
-# drawElements CMake utilities
-# ----------------------------
-#
-# Copyright 2014 The Android Open Source Project
-#
-# 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.
-#
-#-------------------------------------------------------------------------
-
-cmake_minimum_required(VERSION 2.6)
-
-project(delibs)
-
-include(cmake/Defs.cmake NO_POLICY_SCOPE)
-include(cmake/CFlags.cmake)
-
-# Internal library projects.
-add_subdirectory(debase)
-add_subdirectory(depool)
-add_subdirectory(dethread)
-add_subdirectory(deimage)
-add_subdirectory(deutil)
-add_subdirectory(destream)
-
-# External library projects.
-add_subdirectory(zlib)
-add_subdirectory(libpng)
-add_subdirectory(libzip)
depool
dethread
deutil
- libpng
+ ${PNG_LIBRARY}
)
if (DE_OS_IS_UNIX)
#include "deMutex.h"
#if defined(QP_SUPPORT_PNG)
-# include "png.h"
+# include <png.h>
#endif
#include <stdio.h>