FasTC/Base/test/CMakeLists.txt

55 lines
1.6 KiB
CMake
Raw 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/>
2014-01-30 18:55:55 +00:00
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include )
INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include )
INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/GTest/include)
SET(TESTS
2014-03-10 22:30:27 +00:00
Vector Matrix Pixel Image Color Bits
)
FOREACH(TEST ${TESTS})
SET(TEST_NAME Test_Base_${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})
2014-02-16 18:20:43 +00:00
# Vector tests need to use uninitialized variables
2014-02-20 20:34:12 +00:00
IF((${TEST_NAME} STREQUAL "Test_Base_Vector")
OR
(${TEST_NAME} STREQUAL "Test_Base_Matrix"))
2014-02-16 18:20:43 +00:00
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
SET_TARGET_PROPERTIES(
${TEST_NAME}
PROPERTIES
COMPILE_FLAGS
"-Wno-uninitialized")
ENDIF()
ENDIF()
TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCBase)
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest_main)
ADD_TEST(${TEST_NAME} ${TEST_NAME})
ENDFOREACH()