2016-08-17 23:49:13 +00:00
|
|
|
# Copyright 2016 The University of North Carolina at Chapel Hill
|
2013-08-30 22:44:50 +00:00
|
|
|
#
|
2016-08-17 23:49:13 +00:00
|
|
|
# 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
|
2013-08-30 22:44:50 +00:00
|
|
|
#
|
2016-08-17 23:49:13 +00:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2013-08-30 22:44:50 +00:00
|
|
|
#
|
2016-08-17 23:49:13 +00:00
|
|
|
# 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.
|
2013-08-30 22:44:50 +00:00
|
|
|
#
|
|
|
|
# Please send all BUG REPORTS to <pavel@cs.unc.edu>.
|
|
|
|
# <http://gamma.cs.unc.edu/FasTC/>
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/PVRTCEncoder/include)
|
2013-09-30 16:04:00 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/PVRTCEncoder/include)
|
2013-08-30 22:44:50 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/PVRTCEncoder/src)
|
|
|
|
|
2014-01-30 18:55:55 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include )
|
|
|
|
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include )
|
|
|
|
|
2014-09-02 20:52:31 +00:00
|
|
|
IF( DEBUG_PVRTC_DECODER )
|
|
|
|
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Core/include )
|
2014-11-18 22:07:26 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Core/include )
|
2014-09-02 20:52:31 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/IO/include )
|
2014-11-18 22:07:26 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/IO/include )
|
2014-09-02 20:52:31 +00:00
|
|
|
ENDIF( DEBUG_PVRTC_DECODER )
|
|
|
|
|
2013-08-30 22:44:50 +00:00
|
|
|
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/GTest/include)
|
|
|
|
|
|
|
|
SET(TESTS
|
2013-10-03 21:25:15 +00:00
|
|
|
Block Image Decompressor
|
2013-08-30 22:44:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
FOREACH(TEST ${TESTS})
|
2013-10-04 22:35:18 +00:00
|
|
|
SET(TEST_NAME Test_PVRTCEncoder_${TEST})
|
2013-09-05 00:21:28 +00:00
|
|
|
SET(TEST_MODULE ${TEST}Test.cpp)
|
2013-11-17 19:17:00 +00:00
|
|
|
|
|
|
|
# HACK for MSVC 2012...
|
|
|
|
IF(MSVC)
|
|
|
|
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
|
|
|
|
ENDIF()
|
|
|
|
|
2013-09-05 00:21:28 +00:00
|
|
|
ADD_EXECUTABLE(${TEST_NAME} ${TEST_MODULE})
|
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} PVRTCEncoder)
|
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)
|
|
|
|
ADD_TEST(${TEST_NAME} ${TEST_NAME})
|
2013-08-30 22:44:50 +00:00
|
|
|
ENDFOREACH()
|
|
|
|
|
2013-09-05 00:21:56 +00:00
|
|
|
# Test the decompressor against the included PVR Texture library....
|
|
|
|
IF(PVRTEXLIB_FOUND)
|
|
|
|
|
2013-10-04 22:35:18 +00:00
|
|
|
SET(TEST_NAME Test_PVRTCEncoder_DecompVersusPVRLib)
|
2013-09-05 00:21:56 +00:00
|
|
|
|
|
|
|
# Copy the .pvr files that we will use for testing...
|
|
|
|
SET(TEST_IMAGES
|
2013-09-12 18:04:20 +00:00
|
|
|
4bpp-gradient 4bpp-white 4bpp-gray 4bpp-transparent 4bpp-trans-gradient
|
|
|
|
2bpp-gradient 2bpp-white 2bpp-gray 2bpp-transparent 2bpp-trans-gradient
|
2013-09-05 00:21:56 +00:00
|
|
|
)
|
|
|
|
FOREACH(IMAGE ${TEST_IMAGES})
|
|
|
|
FILE(COPY
|
|
|
|
${FasTC_SOURCE_DIR}/PVRTCEncoder/test/data/${IMAGE}.pvr
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}
|
|
|
|
USE_SOURCE_PERMISSIONS
|
|
|
|
)
|
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
# Make sure to include the PVR library headers...
|
|
|
|
INCLUDE_DIRECTORIES( ${PVRTEXLIB_INCLUDE_DIRS} )
|
2014-11-18 22:07:26 +00:00
|
|
|
INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Core/include )
|
2013-09-05 00:21:56 +00:00
|
|
|
|
2013-11-17 19:17:00 +00:00
|
|
|
# HACK for MSVC 2012...
|
|
|
|
IF(MSVC)
|
|
|
|
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
|
|
|
|
ENDIF()
|
|
|
|
|
2013-09-05 00:21:56 +00:00
|
|
|
# The cpp file to compile for the test
|
|
|
|
ADD_EXECUTABLE(${TEST_NAME} DecompTestPVR.cpp)
|
|
|
|
|
|
|
|
# Libraries that we need...
|
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} PVRTCEncoder)
|
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)
|
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} ${PVRTEXLIB_LIBRARIES} )
|
2013-09-17 22:35:56 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCBase)
|
2013-09-06 06:02:02 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCIO)
|
|
|
|
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCCore)
|
2013-09-05 00:21:56 +00:00
|
|
|
|
2013-09-25 18:42:35 +00:00
|
|
|
IF(MSVC)
|
|
|
|
ADD_TEST(${TEST_NAME}
|
|
|
|
${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Debug/${TEST_NAME}
|
|
|
|
)
|
|
|
|
ELSE()
|
|
|
|
ADD_TEST(${TEST_NAME}
|
|
|
|
${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}
|
|
|
|
)
|
|
|
|
ENDIF()
|
|
|
|
|
2013-09-05 00:21:56 +00:00
|
|
|
ENDIF(PVRTEXLIB_FOUND)
|