Move FindQt5Test logic inside tests directory

This commit is contained in:
Matt Williams 2015-02-28 10:40:05 +00:00
parent d9dae773dc
commit 41d5ea6178
2 changed files with 48 additions and 43 deletions

View File

@ -33,11 +33,6 @@ MARK_AS_ADVANCED(FORCE POLYVOX_VERSION)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
include(FeatureSummary) include(FeatureSummary)
find_package(Qt5Test 5.2)
set_package_properties(Qt5Test PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org)
set_package_properties(Qt5Test PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests")
IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW" IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW"
ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode
ENDIF() ENDIF()
@ -57,11 +52,10 @@ ENDIF()
INCLUDE(Packaging.cmake) INCLUDE(Packaging.cmake)
OPTION(ENABLE_TESTS "Should the tests be built" ON) OPTION(ENABLE_TESTS "Should the tests be built" ON)
IF(ENABLE_TESTS AND Qt5Test_FOUND) IF(ENABLE_TESTS)
INCLUDE(CTest) INCLUDE(CTest)
MARK_AS_ADVANCED(FORCE BUILD_TESTING) MARK_AS_ADVANCED(FORCE BUILD_TESTING)
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)
SET(BUILD_TESTS ON)
ELSE() ELSE()
SET(BUILD_TESTS OFF) SET(BUILD_TESTS OFF)
ENDIF() ENDIF()

View File

@ -20,6 +20,11 @@
# 3. This notice may not be removed or altered from any source # 3. This notice may not be removed or altered from any source
# distribution. # distribution.
find_package(Qt5Test 5.2)
set_package_properties(Qt5Test PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org)
set_package_properties(Qt5Test PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests")
# Creates a test from the inputs # Creates a test from the inputs
# #
# Also sets LATEST_TEST to point to the output executable of the test for easy # Also sets LATEST_TEST to point to the output executable of the test for easy
@ -66,39 +71,45 @@ IF(BUILD_BINDINGS)
ENDIF() ENDIF()
ENDIF() ENDIF()
# AmbientOcclusionGenerator tests if(Qt5Test_FOUND)
CREATE_TEST(TestAmbientOcclusionGenerator.cpp TestAmbientOcclusionGenerator) SET(BUILD_TESTS ON PARENT_SCOPE)
# Array tests # AmbientOcclusionGenerator tests
CREATE_TEST(TestArray.cpp TestArray) CREATE_TEST(TestAmbientOcclusionGenerator.cpp TestAmbientOcclusionGenerator)
# AStarPathfinder tests # Array tests
CREATE_TEST(TestAStarPathfinder.cpp TestAStarPathfinder) CREATE_TEST(TestArray.cpp TestArray)
CREATE_TEST(TestCubicSurfaceExtractor.cpp TestCubicSurfaceExtractor) # AStarPathfinder tests
CREATE_TEST(TestAStarPathfinder.cpp TestAStarPathfinder)
# Low pass filter tests
CREATE_TEST(TestLowPassFilter.cpp TestLowPassFilter) CREATE_TEST(TestCubicSurfaceExtractor.cpp TestCubicSurfaceExtractor)
# Material tests # Low pass filter tests
CREATE_TEST(testmaterial.cpp testmaterial) CREATE_TEST(TestLowPassFilter.cpp TestLowPassFilter)
# Raycast tests # Material tests
CREATE_TEST(TestRaycast.cpp TestRaycast) CREATE_TEST(testmaterial.cpp testmaterial)
# Picking tests # Raycast tests
CREATE_TEST(TestPicking.cpp TestPicking) CREATE_TEST(TestRaycast.cpp TestRaycast)
# Region tests # Picking tests
CREATE_TEST(TestRegion.cpp TestRegion) CREATE_TEST(TestPicking.cpp TestPicking)
CREATE_TEST(TestSurfaceExtractor.cpp TestSurfaceExtractor) # Region tests
CREATE_TEST(TestRegion.cpp TestRegion)
#Vector tests
CREATE_TEST(testvector.cpp testvector) CREATE_TEST(TestSurfaceExtractor.cpp TestSurfaceExtractor)
# Volume tests #Vector tests
CREATE_TEST(testvolume.cpp testvolume) CREATE_TEST(testvector.cpp testvector)
# Volume subclass tests # Volume tests
CREATE_TEST(TestVolumeSubclass.cpp TestVolumeSubclass) CREATE_TEST(testvolume.cpp testvolume)
# Volume subclass tests
CREATE_TEST(TestVolumeSubclass.cpp TestVolumeSubclass)
else()
SET(BUILD_TESTS OFF PARENT_SCOPE)
endif()