FasTC/ASTCEncoder/test/CMakeLists.txt

94 lines
2.9 KiB
Text
Raw Permalink Normal View History

2016-08-17 23:49:13 +00:00
# Copyright 2016 The University of North Carolina at Chapel Hill
#
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
#
2016-08-17 23:49:13 +00:00
# http://www.apache.org/licenses/LICENSE-2.0
#
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.
#
# Please send all BUG REPORTS to <pavel@cs.unc.edu>.
# <http://gamma.cs.unc.edu/FasTC/>
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/ASTCEncoder/include)
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/ASTCEncoder/include)
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/ASTCEncoder/src)
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include )
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include )
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/GTest/include)
SET(TESTS
IntegerEncoding
)
FOREACH(TEST ${TESTS})
SET(TEST_NAME Test_ASTCEncoder_${TEST})
SET(TEST_MODULE Test${TEST}.cpp)
# HACK for MSVC 2012...
IF(MSVC)
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
ENDIF()
ADD_EXECUTABLE(${TEST_NAME} ${TEST_MODULE})
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCBase)
TARGET_LINK_LIBRARIES(${TEST_NAME} ASTCEncoder)
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)
ADD_TEST(${TEST_NAME} ${TEST_NAME})
ENDFOREACH()
2016-08-17 18:18:28 +00:00
IF( PNG_FOUND )
# Setup the test that makes sure that we don't have any
# regressions in the ASTC decoder.
SET(TEST_NAME Test_ASTCEncoder_Decompress)
# Copy the .pvr files that we will use for testing...
SET(TEST_IMAGES 4x4 12x12 8x8 6x5 10x8 )
FOREACH(IMAGE ${TEST_IMAGES})
FILE(
COPY ${FasTC_SOURCE_DIR}/ASTCEncoder/test/data/mandrill_${IMAGE}.astc
DESTINATION ${CMAKE_BINARY_DIR}
USE_SOURCE_PERMISSIONS
)
2016-08-17 18:18:28 +00:00
ENDFOREACH()
2016-08-17 18:18:28 +00:00
FOREACH(IMAGE ${TEST_IMAGES})
FILE(
COPY ${FasTC_SOURCE_DIR}/ASTCEncoder/test/data/mandrill_decompressed_${IMAGE}.png
DESTINATION ${CMAKE_BINARY_DIR}
USE_SOURCE_PERMISSIONS
)
ENDFOREACH()
INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/include )
INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/IO/include )
INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include )
INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Core/include )
2016-08-17 18:18:28 +00:00
# HACK for MSVC 2012...
IF(MSVC)
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
ENDIF()
2016-08-17 18:18:28 +00:00
# The cpp file to compile for the test
ADD_EXECUTABLE(${TEST_NAME} TestASTCDecompression.cpp)
2016-08-17 18:18:28 +00:00
# Libraries that we need...
TARGET_LINK_LIBRARIES(${TEST_NAME} ASTCEncoder)
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCBase)
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCIO)
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCCore)
2016-08-17 18:18:28 +00:00
ADD_TEST(NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${TEST_NAME})
2016-08-17 18:18:28 +00:00
ENDIF( PNG_FOUND )